Files
graphql-api-js/src/schema.graphql
T
Arwid ThornströmandGitHub a298b3474e added support for room_types (#183)
* added support for room_types

* backwards compability
2025-12-16 10:44:24 +01:00

569 lines
9.9 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
orderByExternalId(klarnaOrderId: ID, paypalTransactionId: ID): Order
products(
pagination: PaginationInput!
filter: ProductsFilterInput
): ProductsResult
product(id: Int!): Product
productByPath(path: String!): Product
productsSearch(q: String!): ProductsSearchResult
categories(ids: [Int]): [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(input: InteriorsInput): [Interior]
signedFileUploadURL(config: SignedUploadURLInput): SignedUploadURL
@cacheControl(maxAge: 0)
translate(input: TranslateInput!): StringResult!
collections: [Collection]
collection(id: Int!): Collection
}
type HealthCheck {
result: String!
}
input TranslateInput {
text: String!
"""
defaults to auto
"""
sourceLanguageCode: String
targetLanguageCode: String!
}
input SignedUploadURLInput {
contentType: String!
key: String!
}
input PaginationInput {
limit: Int!
offset: Int
}
input DateInput {
from: Date!
to: Date!
}
input DateFilterInput {
dates: DateInput
}
input ProductsFilterInput {
visible: Boolean
browsable: Boolean
ids: [Int]
}
type PaginationResult {
total: Int!
offset: Int!
limit: Int!
}
type OrdersResult {
pagination: PaginationResult!
items: [Order]
}
type ProductsResult {
pagination: PaginationResult!
items: [Product]
}
type ProductsSearchResult {
q: String!
"""
products contains matches for `name` and `artNo`
"""
products: [Product]
batches: [Batch]
keywords: [Keyword]
categories: [Category]
designers: [Designer]
copyrights: [Copyright]
references: [Product]
}
input InteriorsInput {
productId: Int!
}
type SignedUploadURL {
url: String!
key: String!
bucket: String!
expires: Int!
}
type Market {
id: ID!
name: String!
vat: Float!
currency: String!
priceAdjustment: Float!
locales: [Locale]!
}
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
email: String
phone: String
}
type Order {
id: ID!
klarnaOrderId: String
paypalTransactionId: String
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
orderSum: Float
pwintyId: Int
billingAddress: Address
deliveryAddress: Address
billingAddressId: Int
deliveryAddressId: Int
market: Market
locale: Locale
rows: [OrderRow]
}
type OrderRow {
id: ID!
order: Order
data: OrderRowData
}
type OrderRowData {
frameColor: String
pwintyImageId: Int
pwintySku: String
}
type CategoryLocaleData {
path: String
name: String
locale: String
}
type Category {
id: ID!
name: String
path: String
pathNumeric: String
isLeaf: Int
depth: Int
childCount: Int
lft: Int
rgt: Int
"""
Default to false
"""
products(includeAllSubCategories: Boolean): [Product]
localeNames: JSON
localeData(locales: [String]!): [CategoryLocaleData]!
}
type Batch {
name: String!
products: [Product]
}
type Copyright {
name: String!
products: [Product]
}
type Facet {
attribute: String
values: [String]
}
type Product {
id: ID!
stockid: Int
path: String!
visible: Boolean!
browsable: Boolean!
inserted: DateTime!
updated: DateTime
publishingDate: DateTime!
printProducts(groups: [ProductGroup]): [PrintProduct]
blacklisting: [ProductBlacklist]
categories: [Category]
collections: [Collection]
designerId: Int
designer: Designer
keywords: [Keyword]
ref1: String
ref2: String
ref3: String
ref4: String
related: [Product]
wallpaperTypes: [ProductWallpaperType]!
fields: ProductFields
orientation: Orientation
facets: [Facet]
is_ai_generated: Boolean!
"""
Will be single values return in later release
"""
type: [ProductType]
}
type ProductFields {
artNo: String!
name: String!
localeNames: JSON
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
comments: String
}
enum Orientation {
UNKNOWN
STANDING
LANDSCAPE
SQUARE
}
enum ProductGroup {
PHOTO_WALLPAPER
CANVAS
"""
WALLPAPER is tiling
"""
WALLPAPER
OLD_REMOVED
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]
defaults: PrintProductDefaults
}
enum InteriorType {
WALLPAPER
PAINTING
POSTER
FRAMED_PRINT
}
type Interior {
"""
room id
"""
id: ID!
roomName: String
position: Int
roomType: String
roomTypes: [String]
"""
uri is set when there is a generated file on s3, null otherwise
"""
uri: String
roomNumber: Int
type: InteriorType
orientation: Orientation
}
enum BorderType {
NONE
WHITE
BLACK
}
type PrintProductDefaults {
printId: ID
widthMm: Float
heightMm: Float
cropX: Float
cropY: Float
border: BorderType
}
type Designer {
id: ID!
name: String
path: String
excludeFromSearch: Boolean
orderRows(pagination: PaginationInput!, filter: DateFilterInput): [OrderRow]
products: [Product]
}
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!
ref4: String!
designerId: Int
browsable: Boolean!
visible: Boolean!
publishingDate: DateTime!
printFileWidth: Int!
printFileHeight: Int!
printFileDpi: Int!
is_ai_generated: Boolean!
}
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 StringResult {
value: String!
}
type IdNumberResult {
id: Int!
}
type CleanupResponse {
active: [String]
deleted: [String]
}
type Mutation {
"""
Product
"""
addProduct(name: String!, batch: String, designerId: Int): Product
productInfo(productId: Int!, info: ProductInfoInput!): Product
productWallpaperType(
productId: Int!
wallpaperTypes: [ProductWallpaperType]!
): Product
productBlacklisting(
productId: Int!
markets: [ProductBlacklistingInput]
): Product
"""
Product Image
"""
productFocusPoint(
productId: Int!
focusXpoint2: Float!
focusYpoint2: Float!
): Product
productProportionsWarning(
productId: Int!
proportions: ProductProportionsInput!
): Product
updateProductImage(
productId: Int!
uploadedS3Key: String!
width: Int!
height: Int!
): String
"""
Product Relations
"""
addRelatedProducts(productId: Int!, articleNumbers: [String]!): Product
removeRelatedProducts(productId: Int!, relatedProductIds: [Int]!): Product
"""
Product Categories
"""
addCategoriesToProduct(productId: Int!, categoryIds: [Int]!): Product
removeCategoriesFromProduct(productId: Int!, categoryIds: [Int]!): Product
"""
Product Keywords
"""
productKeywords(productId: Int!, keywordIds: [Int]): Product
addKeyword(name: String!, type: KeywordType): Keyword
"""
Product Other
"""
updateProductComments(productId: Int!, comments: String!): Product
"""
Printproducts
"""
productGroup(productId: Int!, groupIds: [Int]): Product
productGroupInteriors(productId: Int!, groupId: Int!, uris: [String]): Product
generateInteriors(productId: Int!, roomIds: [String]!): StringResult
cleanupInteriors(productId: Int!): CleanupResponse
addOwnInteriorToPrintProduct(
printId: Int!
uploadedS3Key: String!
): IdNumberResult
printProductDefaults(
printId: Int!
widthMm: Int!
heightMm: Int!
cropX: Float!
cropY: Float!
border: BorderType!
): PrintProductDefaults
"""
Mass Update
"""
massUpdatePublishing(
productIds: [Int]!
visible: Boolean
browsable: Boolean
): StringResult
massUpdateBlacklisting(
productIds: [Int]!
markets: [ProductBlacklistingInput]
): StringResult
massUpdatePublishingDate(productIds: [Int]!, date: DateTime!): StringResult
}
type Collection {
id: ID!
name: String!
productIds: [Int!]!
}