Files
graphql-api-js/src/schema.graphql
T
Arwid ThornströmandGitHub 613ec8aad0 47: refactor interiors mutation to handle uri (#48)
* 47: refactor interiors mutation to handle uri

* removed log
2021-09-17 15:40:50 +02:00

473 lines
8.3 KiB
GraphQL

"""
Photowall Graphql Schema
"""
scalar DateTime
scalar Date
scalar JSON
enum CacheControlScope {
PUBLIC
PRIVATE
}
directive @cacheControl(
maxAge: Int
scope: CacheControlScope
inheritMaxAge: Boolean
) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION
type Query {
orders(pagination: PaginationInput!, filter: DateFilterInput!): OrdersResult
order(id: ID!): Order
products(
pagination: PaginationInput!
filter: ProductsFilterInput!
): ProductsResult
product(id: Int!): Product
categories: [Category]
category(id: Int!): Category
keywords: [Keyword]
keyword(id: Int!): Keyword
designers(limit: Int): [Designer]
designer(id: Int!): Designer
markets: [Market]
market(name: String!): Market
locales: [Locale]
locale(value: String!): Locale
interiors(filter: InteriorsFilterInput): [Interior]
signedFileUploadURL(config: SignedUploadURLInput): SignedUploadURL
@cacheControl(maxAge: 0)
}
input SignedUploadURLInput {
contentType: String!
key: String!
}
input PaginationInput {
limit: Int!
"""
offset is not implemented yet and result will always return as if it was 0. Implement when needed.
"""
offset: Int
}
input DateInput {
from: Date!
to: Date!
}
input DateFilterInput {
dates: DateInput
}
input ProductsFilterInput {
visible: Boolean
browsable: Boolean
}
type PaginationResult {
total: Int!
offset: Int!
limit: Int!
}
type OrdersResult {
pagination: PaginationResult!
items: [Order]
}
type ProductsResult {
pagination: PaginationResult!
items: [Product]
}
input InteriorsFilterInput {
productId: Int!
}
type SignedUploadURL {
url: String!
key: String!
bucket: String!
expires: Int!
}
type Market {
id: ID!
name: String!
vat: Float!
currency: String!
priceAdjustment: Float!
}
type Locale {
id: ID!
value: String!
name: String!
fallbackId: Int
}
type Address {
id: ID!
firstname: String
lastname: String
recipientName: String
companyname: String
address1: String
address2: String
countryCode: String
city: String
zipcode: String
stateCountyOrRegion: String
}
type ContactInformation {
email: String
phone: String
address: Address
}
type Order {
id: ID!
inserted: DateTime!
paid: Boolean!
confirmed: Boolean!
delivered: Boolean!
newsletter: Boolean
creditInvoice: Boolean
canceled: Boolean
reminder: Boolean
deliveredDate: DateTime
countryCode: String
language: String
deliveryCountryCode: String
deliveryMethod: String
deliveryPrice: String
deliveryVat: Float
customerType: String
paymentType: String
attention: String
currency: String
exchangeRate: Float
exchangeRateEur: Float
invoiceId: String
contractCustomerId: Int
vatNumber: String
comment: String
cancelsOrderId: Int
cancelledByOrderId: Int
orderlogId: Int
resellerStore: String
orderSum: Float
klarnaOrderId: String
pwintyId: Int
email: String
phone: String
deliveryEmail: String
deliveryPhone: String
customerFirstname: String
customerLastname: String
customerEmail: String
customerCellphone: String
flyerIds: String
billingInformation: ContactInformation
deliveryInformation: ContactInformation
billingAddressId: Int
deliveryAddressId: Int
"""
pwinty needs to be updated with market being a subtype
"""
market: Market
locale: Locale
rows: [OrderRow]
}
type OrderRow {
id: ID!
artNo: String
code: String
commission: Int
commissionAmount: Float
commissionResale: Int
designer: String
designerId: Int
designerPath: String
discountType: String
discountValue: Float
displayHeight: Float
displayWidth: Float
edge: String
frameColor: String
framed: Int
group: ProductGroup
height: Int
imagedonotprint: Int
imageprocessed: Int
imageprocessingrejected: Int
inserted: DateTime
material: String
measureUnit: String
mirrored: Int
modifier: String
name: String
noShipping: Boolean
order: Order
orderId: Int
path: String
price: Float
printId: Int
process: Boolean
productGroup: String
productId: Int
pwintyImageId: Int
pwintySku: String
resolution: Int
status: String
type: String
vat: Float
weight: Int
width: Int
x: Float
y: Float
}
type Category {
id: ID!
name: String
path: String
pathNumeric: String
isLeaf: Int
depth: Int
childCount: Int
lft: Int
rgt: Int
products: [Product]
}
type Product {
id: ID!
stockid: Int
path: String!
visible: Boolean!
browsable: Boolean!
inserted: DateTime!
updated: DateTime
printProducts: [PrintProduct]
blacklisting: [ProductBlacklist]
categories: [Category]
designerId: Int
designer: Designer
keywords: [Keyword]
ref1: String
ref2: String
ref3: String
related: [Product]
wallpaperTypes: [ProductWallpaperType]!
fields: ProductFields
orientation: Orientation
"""
Will be single values return in later release
"""
type: [ProductType]
}
type ProductFields {
artNo: String!
name: String!
height: Int
width: Int
photowallResolution: Int
canvasResolution: Int
wallpaperResolution: Int
copyright: String!
proportionsWarning: Boolean!
marginWidthMax: Int
marginWidthMin: Int
marginHeightMax: Int
marginHeightMin: Int
focusXpoint: Float
focusYpoint: Float
focusXpoint2: Float
focusYpoint2: Float
batch: String
imageResolution: Int
printFileWidth: Int
printFileHeight: Int
printFileDpi: Int
}
enum Orientation {
UNKNOWN
STANDING
LANDSCAPE
SQUARE
}
enum ProductGroup {
PHOTO_WALLPAPER
CANVAS
"""
WALLPAPER is tiling
"""
WALLPAPER
OLD_REMOVED
DO_IT_YOURSELF_FRAME
"""
Not used
"""
DESIGNER_WALLPAPER
POSTER
FRAMED_PRINT
UNKNOWN
}
enum ProductType {
UNKNOWN
PHOTO
ILLUSTRATION
}
enum ProductWallpaperType {
WALLMURAL
DESIGN
}
type ProductBlacklist {
id: ID!
groupId: Int!
group: ProductGroup!
market: Market!
inserted: DateTime!
updated: DateTime!
}
type PrintProduct {
id: ID!
groupId: Int!
group: ProductGroup!
inserted: DateTime!
updated: DateTime
interiors: [Interior]
}
enum InteriorType {
WALLPAPER
PAINTING
POSTER
FRAMED_PRINT
}
type Interior {
"""
room id
"""
id: ID!
roomName: String
position: Int
roomType: String
uri: String
roomNumber: Int
type: InteriorType
orientation: Orientation
}
type Designer {
id: ID!
name: String
path: String
orderRows(pagination: PaginationInput!, filter: DateFilterInput): [OrderRow]
}
enum KeywordType {
NOT_SET
COLOR
}
type Keyword {
id: ID!
value: String!
type: KeywordType
products: [Product]
}
# Mutations below
input ProductInfoInput {
name: String!
artNo: String!
path: String!
batch: String!
copyright: String!
ref1: String!
ref2: String!
ref3: String!
designerId: Int
browsable: Boolean!
visible: Boolean!
printFileWidth: Int!
printFileHeight: Int!
printFileDpi: Int!
}
input ProductBlacklistingInput {
"""
Only ones used are ProductGroup: PHOTO_WALLPAPER CANVAS WALLPAPER POSTER
"""
marketId: Int!
groupIds: [Int]
}
input ProductProportionsInput {
proportionsWarning: Boolean
marginWidthMax: Int!
marginWidthMin: Int!
marginHeightMax: Int!
marginHeightMin: Int!
}
type IdNumberResult {
id: Int!
}
type Mutation {
productInfo(productId: Int!, info: ProductInfoInput!): Product
productFocusPoint(
productId: Int!
focusXpoint2: Float!
focusYpoint2: Float!
): Product
productBlacklisting(
productId: Int!
markets: [ProductBlacklistingInput]
): Product
productGroup(productId: Int!, groupIds: [Int]): Product
productGroupInteriors(productId: Int!, groupId: Int!, uris: [String]): Product
productKeywords(productId: Int!, keywordIds: [Int]): Product
productProportionsWarning(
productId: Int!
proportions: ProductProportionsInput!
): Product
addOwnInteriorToPrintProduct(
printId: Int!
uploadedS3Key: String!
): IdNumberResult
productWallpaperType(
productId: Int!
wallpaperTypes: [ProductWallpaperType]!
): Product
updateProductImage(
productId: Int!
uploadedS3Key: String!
width: Int!
height: Int!
): String
addRelatedProducts(productId: Int!, articleNumbers: [String]!): Product
removeRelatedProducts(productId: Int!, relatedProductIds: [Int]!): Product
addKeyword(name: String!, type: KeywordType): Keyword
addCategoriesToProduct(productId: Int!, categoryIds: [Int]!): Product
removeCategoriesFromProduct(productId: Int!, categoryIds: [Int]!): Product
}