Files
sell/middlelayer/schema.ts

218 lines
3.8 KiB
TypeScript

export const typeDefs = `#graphql
type ProductPromotion {
category: String!
text: String!
}
type Product {
id: ID!
name: String!
description: String
price: Float!
originalPrice: Float
currency: String!
imageUrl: String
category: String
inStock: Boolean!
promotion: ProductPromotion
}
type PageSeo {
title: String!
description: String!
metaRobotsIndex: String
metaRobotsFollow: String
}
type contentLayout {
mobile: String!
tablet: String
desktop: String
spaceBottom: Float
}
type HTMLContent {
type: String!
name: String!
html: String!
layout: contentLayout!
}
type MarkdownContent {
type: String!
name: String!
content: String!
layout: contentLayout!
alignment: String!
}
type IframeContent {
type: String!
name: String!
content: String!
iframe: String!
overlayImageUrl: String
layout: contentLayout!
}
type ImageGalleryContent {
type: String!
name: String!
images: [ImageGalleryImage!]!
description: String
layout: contentLayout!
}
type ImageGalleryImage {
url: String!
title: String
description: String
}
type ImageContent {
type: String!
name: String!
imageUrl: String!
caption: String!
maxWidth: Float
aspectRatio: Float
layout: contentLayout!
}
type QuoteContent {
type: String!
quote: String!
author: String!
variant: String!
layout: contentLayout!
}
type YoutubeVideoContent {
type: String!
id: String!
youtubeId: String!
params: String
title: String
description: String
layout: contentLayout!
}
type HeadlineContent {
type: String!
internal: String!
text: String!
tag: String!
align: String
layout: contentLayout!
}
union ContentItem = HTMLContent | MarkdownContent | IframeContent | ImageGalleryContent | ImageContent | QuoteContent | YoutubeVideoContent | HeadlineContent
type ContentRow {
justifyContent: String!
alignItems: String!
content: [ContentItem!]!
}
type Page {
slug: String!
name: String!
linkName: String!
headline: String!
subheadline: String!
seoTitle: String!
seoMetaRobots: String!
seoDescription: String!
topFullwidthBanner: FullwidthBanner
row1: ContentRow
row2: ContentRow
row3: ContentRow
}
type FullwidthBanner {
name: String!
variant: String!
headline: String!
subheadline: String!
text: String!
imageUrl: String
}
type NavigationLink {
slug: String
name: String!
linkName: String!
url: String
icon: String
newTab: Boolean
}
type Navigation {
name: String!
internal: String!
links: [NavigationLink!]!
}
enum UserRole {
ADMIN
CUSTOMER
GUEST
}
type User {
id: ID!
email: String!
name: String!
role: UserRole!
createdAt: String!
}
type AuthResponse {
user: User!
token: String!
}
type Translation {
key: String!
value: String!
namespace: String
}
type Translations {
locale: String!
translations: [Translation!]!
}
type Query {
products(limit: Int): [Product!]!
product(id: ID!): Product
pageSeo(locale: String): PageSeo!
page(slug: String!, locale: String): Page
pages(locale: String): [Page!]!
homepage(locale: String): Page
navigation(locale: String): Navigation!
me: User
translations(locale: String!, namespace: String): Translations!
}
type Mutation {
register(email: String!, password: String!, name: String!): AuthResponse!
login(email: String!, password: String!): AuthResponse!
}
type __Type {
kind: __TypeKind!
}
enum __TypeKind {
SCALAR
OBJECT
INTERFACE
UNION
ENUM
INPUT_OBJECT
LIST
NON_NULL
}
`;