type ItemImage { url: String! thumbnailUrl: String! largeUrl: String! } type PageInfo { endCursor: String hasNextPage: Boolean! } type Material { image: ItemImage id: ID! name: String! description: String sku: String supplierSku: String price: String unitId: ID categoryId: ID version: Int! } type Component { image: ItemImage id: ID! name: String! description: String sku: String supplierSku: String price: String categoryId: ID templateId: ID templateName: String version: Int! } type ComponentTemplate { id: ID! name: String! description: String image: ItemImage version: Int! componentCount: Int! } type ComponentTemplateConnection { nodes: [ComponentTemplate!]! pageInfo: PageInfo! } type ComponentTemplateAssignmentResult { components: [MutationResult!]! } type Product { image: ItemImage id: ID! name: String! description: String basePrice: String version: Int! } type Variant { image: ItemImage id: ID! productId: ID! sku: String price: String optionSignature: String! version: Int! } type Site { id: ID! name: String! notes: String } type NamedResource { id: ID! name: String! } type ProductOption { id: ID! productId: ID! name: String! position: Int! } type OptionValue { id: ID! optionId: ID! value: String! position: Int! } type CompositionItem { id: ID! materialId: ID componentId: ID quantity: Float! } enum VariantItemSource { PRODUCT OPTION_VALUE VARIANT } type EffectiveVariantItem { id: ID! variantId: ID! materialId: ID componentId: ID quantity: Float! source: VariantItemSource! sourceOptionId: ID sourceOptionValueId: ID sourceLabel: String } type EffectiveVariantItemConnection { nodes: [EffectiveVariantItem!]! pageInfo: PageInfo! } type InventoryItem { id: ID! siteId: ID! materialId: ID componentId: ID productVariantId: ID quantity: Int! location: String version: Int! } type InventoryAdjustment { id: ID! inventoryItemId: ID siteId: ID! targetId: ID! targetType: String! targetName: String! eventKind: String! adjustmentType: String! reason: String! quantity: Int! delta: Int! countBefore: Int! countAfter: Int! note: String createdAt: String! } type MaterialConnection { nodes: [Material!]! pageInfo: PageInfo! } type ComponentConnection { nodes: [Component!]! pageInfo: PageInfo! } type ProductConnection { nodes: [Product!]! pageInfo: PageInfo! } type VariantConnection { nodes: [Variant!]! pageInfo: PageInfo! } type SiteConnection { nodes: [Site!]! pageInfo: PageInfo! } type NamedResourceConnection { nodes: [NamedResource!]! pageInfo: PageInfo! } type ProductOptionConnection { nodes: [ProductOption!]! pageInfo: PageInfo! } type OptionValueConnection { nodes: [OptionValue!]! pageInfo: PageInfo! } type CompositionConnection { nodes: [CompositionItem!]! pageInfo: PageInfo! } type InventoryConnection { nodes: [InventoryItem!]! pageInfo: PageInfo! } type AdjustmentConnection { nodes: [InventoryAdjustment!]! pageInfo: PageInfo! } type InventoryOptions { alertLevels: [Int!]! stopSellingAtMinimum: Boolean! minimumLevel: Int! version: Int! } type AvailabilitySyncVariant { id: ID! shopifyVariantId: ID! inventoryElfVariantId: ID! enabled: Boolean! } type AvailabilitySyncVariantConnection { nodes: [AvailabilitySyncVariant!]! pageInfo: PageInfo! } type AvailabilitySyncLocation { siteId: ID! siteName: String! locationId: ID! locationName: String! enabled: Boolean! finished: Int! buildable: Int! minimum: Int! quantity: Int! blockers: [String!]! } type AvailabilitySync { linked: Boolean! runtimeReady: Boolean! enabled: Boolean version: String error: String attempts: Int attemptLimit: Int discardedAt: String pending: Boolean enabledLocationIds: [ID!] hasMappings: Boolean locations: [AvailabilitySyncLocation!] } type UnavailableSyncLocation { locationId: ID! reason: String! } type AvailabilitySyncEligibleLocations { locationIds: [ID!]! unavailableLocations: [UnavailableSyncLocation!]! } type AvailabilitySyncChange { locationId: ID! locationName: String! siteId: ID! siteName: String! currentQuantity: Int! quantity: Int! } type AvailabilitySyncConfirmation { token: String! changes: [AvailabilitySyncChange!]! refreshed: Boolean! } type AvailabilitySyncResult { enabled: Boolean! confirmation: AvailabilitySyncConfirmation } type AvailabilitySyncRetryResult { queued: Boolean! } input InventoryOptionsInput { siteId: ID! targetType: InventoryTarget! targetId: ID! alertLevels: [Int!]! stopSellingAtMinimum: Boolean! minimumLevel: Int! expectedVersion: Int! idempotencyKey: String! } input AvailabilitySyncInput { shopifyVariantId: ID! locationId: ID! enabled: Boolean! expectedVersion: String! confirmationToken: String idempotencyKey: String! } type MutationResult { id: ID! version: Int } enum AdjustmentDirection { INCREASE DECREASE RECOUNT } enum InventoryReason { STOCK_RECEIVED INVENTORY_RECOUNT DAMAGE THEFT LOSS RETURN SHOP_ORDER STUDIO_USE OTHER MAKING_PRODUCTS MAKING_COMPONENTS } enum InventoryTarget { MATERIAL COMPONENT PRODUCT_VARIANT } input MaterialInput { name: String! description: String sku: String supplierSku: String price: String unitId: ID categoryId: ID } input ComponentItemInput { materialId: ID childComponentId: ID quantity: Int! } input ComponentInput { name: String! description: String sku: String supplierSku: String price: String categoryId: ID templateId: ID items: [ComponentItemInput!]! } input ComponentTemplateMemberInput { id: ID! expectedVersion: Int! } input ComponentTemplateInput { name: String! description: String components: [ComponentTemplateMemberInput!] } input ComponentTemplateUpdateInput { name: String! description: String clearImage: Boolean = false } input ComponentTemplateAssignmentInput { templateId: ID components: [ComponentTemplateMemberInput!]! idempotencyKey: String! } input VariantItemInput { materialId: ID componentId: ID quantity: Float! } input OptionValueInput { id: ID! value: String! priceAdjustment: String } input ProductOptionInput { id: ID! name: String! values: [OptionValueInput!]! } input ProductInput { name: String! description: String basePrice: String options: [ProductOptionInput!] } input ProductUpdateInput { name: String! description: String basePrice: String } input VariantInput { selectedOptionValueIds: [ID!]! sku: String price: String items: [VariantItemInput!]! } input AdjustInventoryInput { inventoryItemId: ID! direction: AdjustmentDirection! quantity: Int! reason: InventoryReason! note: String expectedVersion: Int! idempotencyKey: String! } input AddInventoryInput { siteId: ID! targetType: InventoryTarget! targetId: ID! quantity: Int! location: String note: String idempotencyKey: String! } type Query { inventoryOptions(siteId: ID!, targetType: InventoryTarget!, targetId: ID!): InventoryOptions! availabilitySyncVariants(first: Int = 50, after: String): AvailabilitySyncVariantConnection! availabilitySync(shopifyVariantId: ID!): AvailabilitySync! availabilitySyncEligibleLocations(shopifyVariantId: ID!): AvailabilitySyncEligibleLocations! materials(first: Int = 50, after: String): MaterialConnection! material(id: ID!): Material components(first: Int = 50, after: String, templateId: ID, search: String): ComponentConnection! componentTemplates(first: Int = 50, after: String, search: String): ComponentTemplateConnection! componentTemplate(id: ID!): ComponentTemplate component(id: ID!): Component componentItems(componentId: ID!, first: Int = 50, after: String): CompositionConnection! products(first: Int = 50, after: String): ProductConnection! product(id: ID!): Product variants(productId: ID!, first: Int = 50, after: String): VariantConnection! variant(id: ID!): Variant effectiveVariantItems(variantId: ID!, first: Int = 50, after: String): EffectiveVariantItemConnection! variantItems(variantId: ID!, first: Int = 50, after: String): CompositionConnection! productOptions(productId: ID!, first: Int = 50, after: String): ProductOptionConnection! optionValues(optionId: ID!, first: Int = 50, after: String): OptionValueConnection! categories(first: Int = 50, after: String): NamedResourceConnection! units(first: Int = 50, after: String): NamedResourceConnection! sites(first: Int = 50, after: String): SiteConnection! inventory(siteId: ID!, first: Int = 50, after: String): InventoryConnection! inventoryItem(id: ID!): InventoryItem inventoryHistory(siteId: ID!, inventoryItemId: ID, first: Int = 50, after: String): AdjustmentConnection! } type Mutation { saveInventoryOptions(input: InventoryOptionsInput!): InventoryOptions! setAvailabilitySync(input: AvailabilitySyncInput!): AvailabilitySyncResult! retryAvailabilitySync(shopifyVariantId: ID!, idempotencyKey: String!): AvailabilitySyncRetryResult! createMaterial(input: MaterialInput!, idempotencyKey: String!): MutationResult! updateMaterial(id: ID!, input: MaterialInput!, expectedVersion: Int!, idempotencyKey: String!): MutationResult! deleteMaterial(id: ID!, expectedVersion: Int!, confirm: Boolean!, idempotencyKey: String!): MutationResult! createComponent(input: ComponentInput!, idempotencyKey: String!): MutationResult! createComponentTemplate(input: ComponentTemplateInput!, idempotencyKey: String!): MutationResult! updateComponentTemplate(id: ID!, input: ComponentTemplateUpdateInput!, expectedVersion: Int!, idempotencyKey: String!): MutationResult! deleteComponentTemplate(id: ID!, expectedVersion: Int!, confirm: Boolean!, idempotencyKey: String!): MutationResult! setComponentTemplate(input: ComponentTemplateAssignmentInput!): ComponentTemplateAssignmentResult! updateComponent(id: ID!, input: ComponentInput!, expectedVersion: Int!, idempotencyKey: String!): MutationResult! deleteComponent(id: ID!, expectedVersion: Int!, confirm: Boolean!, idempotencyKey: String!): MutationResult! createProduct(input: ProductInput!, idempotencyKey: String!): MutationResult! updateProduct(id: ID!, input: ProductUpdateInput!, expectedVersion: Int!, idempotencyKey: String!): MutationResult! deleteProduct(id: ID!, expectedVersion: Int!, confirm: Boolean!, idempotencyKey: String!): MutationResult! createVariant(productId: ID!, input: VariantInput!, idempotencyKey: String!): MutationResult! updateVariant(id: ID!, input: VariantInput!, expectedVersion: Int!, idempotencyKey: String!): MutationResult! deleteVariant(id: ID!, expectedVersion: Int!, confirm: Boolean!, idempotencyKey: String!): MutationResult! addInventoryItem(input: AddInventoryInput!): MutationResult! adjustInventory(input: AdjustInventoryInput!): MutationResult! updateInventoryLocation(id: ID!, location: String, expectedVersion: Int!, idempotencyKey: String!): MutationResult! deleteInventoryItem(id: ID!, note: String!, expectedVersion: Int!, confirm: Boolean!, idempotencyKey: String!): MutationResult! }