All Release Notes
Added GraphQL support for Inventory
11 July 2018
Enhancement
GraphQL
- [GraphQL API] The following types were added in the GraphQL schema:
AddInventoryEntryQuantity
,ChangeInventoryEntryQuantity
,InventoryEntry
,InventoryEntryDraft
,InventoryEntryQueryResult
,InventoryEntryUpdateAction
,RemoveInventoryEntryQuantity
,SetInventoryEntryCustomField
,SetInventoryEntryCustomType
,SetInventoryEntryExpectedDelivery
,SetInventoryEntryRestockableInDays
,SetInventoryEntrySupplyChannel
. - [GraphQL API] Type
Query
was changed:- Field
inventoryEntries
was added toQuery
type - Field
inventoryEntry
was added toQuery
type
- Field
- [GraphQL API] Type
Mutation
was changed:- Field
deleteInventoryEntry
was added toMutation
type - Field
createInventoryEntry
was added toMutation
type - Field
updateInventoryEntry
was added toMutation
type
- Field
The following changes were introduced in the GraphQL schema (in SDL format):
extend type Query {inventoryEntries(where: String, sort: [String!], limit: Int, offset: Int): InventoryEntryQueryResult!inventoryEntry(id: String!): InventoryEntry}extend type Mutation {createInventoryEntry(draft: InventoryEntryDraft!): InventoryEntrydeleteInventoryEntry(id: String!, version: Long!): InventoryEntryupdateInventoryEntry(id: String!, version: Long!, actions: [InventoryEntryUpdateAction!]!): InventoryEntry}input AddInventoryEntryQuantity {quantity: Long!}input ChangeInventoryEntryQuantity {quantity: Long!}"Inventory allows you to track stock quantity per SKU and optionally per supply channel"type InventoryEntry {id: String!version: Long!sku: String!supplyChannel: ReferencequantityOnStock: Long!availableQuantity: Long!restockableInDays: IntexpectedDelivery: DateTimecreatedAt: DateTime!lastModifiedAt: DateTime!"This field contains non-typed data. Consider using `customFields` as a typed alternative."customFieldsRaw("""The names of the custom fields to include.If neither `includeNames` nor `excludeNames` are provided, then all custom fields are returned."""includeNames: [String!],"""The names of the custom fields to exclude.If neither `includeNames` nor `excludeNames` are provided, then all custom fields are returned."""excludeNames: [String!]): [RawCustomField!]}input InventoryEntryDraft {sku: String!quantityOnStock: LongrestockableInDays: IntexpectedDelivery: DateTimesupplyChannel: ReferenceInputcustom: CustomFieldsDraft}type InventoryEntryQueryResult {offset: Int!count: Int!total: Long!results: [InventoryEntry!]!}input InventoryEntryUpdateAction {addQuantity: AddInventoryEntryQuantitychangeQuantity: ChangeInventoryEntryQuantityremoveQuantity: RemoveInventoryEntryQuantitysetRestockableInDays: SetInventoryEntryRestockableInDayssetExpectedDelivery: SetInventoryEntryExpectedDeliverysetSupplyChannel: SetInventoryEntrySupplyChannelsetCustomType: SetInventoryEntryCustomTypesetCustomField: SetInventoryEntryCustomField}input RemoveInventoryEntryQuantity {quantity: Long!}input SetInventoryEntryCustomField {name: String!value: String}input SetInventoryEntryCustomType {typeId: StringtypeKey: Stringtype: ResourceIdentifierInputfields: [CustomFieldInput!]}input SetInventoryEntryExpectedDelivery {expectedDelivery: DateTime}input SetInventoryEntryRestockableInDays {restockableInDays: Int}input SetInventoryEntrySupplyChannel {supplyChannel: ReferenceInput}