1 November 2019
CartsGraphQL
You can now query for ShoppingLists and My Shopping Lists on the GraphQL API.
- [GraphQL API] Added the following types to the GraphQL schema:
ShoppingList
,ShoppingListLineItem
,ShoppingListQueryInterface
,ShoppingListQueryResult
,TextLineItem
. - [GraphQL API] Changed the
Me
type:- Added the
shoppingList
field to theMe
type. - Added the
shoppingLists
field to theMe
type.
- Added the
- [GraphQL API] Changed the
InStoreMe
type:- Added the
shoppingList
field to theInStoreMe
type. - Added the
shoppingLists
field to theInStoreMe
type.
- Added the
- [GraphQL API] Changed the
Query
type:- Added the
shoppingList
field to theQuery
type. Query
object type now implementsShoppingListQueryInterface
interface- Added the
shoppingLists
field to theQuery
type.
- Added the
- [GraphQL API] Changed the
MeQueryInterface
type:- Added the
shoppingLists
field to theMeQueryInterface
type. - Added the
shoppingList
field to theMeQueryInterface
type.
- Added the
Introduced the following changes to the GraphQL schema (in SDL format):
extend type Me {
shoppingList(
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): ShoppingList
shoppingLists(where: String, sort: [String!], limit: Int, offset: Int): ShoppingListQueryResult!
}
extend type InStoreMe {
shoppingList(
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): ShoppingList
shoppingLists(where: String, sort: [String!], limit: Int, offset: Int): ShoppingListQueryResult!
}
extend type Query {
shoppingList(
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): ShoppingList
shoppingLists(where: String, sort: [String!], limit: Int, offset: Int): ShoppingListQueryResult!
}
extend interface MeQueryInterface {
shoppingList(
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): ShoppingList
shoppingLists(where: String, sort: [String!], limit: Int, offset: Int): ShoppingListQueryResult!
}
type ShoppingList implements Versioned {
key: String
name(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
"List of languages the client is able to understand, and which locale variant is preferred."
acceptLanguage: [Locale!]): String
nameAllLocales: [LocalizedString!]!
description(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
"List of languages the client is able to understand, and which locale variant is preferred."
acceptLanguage: [Locale!]): String
descriptionAllLocales: [LocalizedString!]
slug(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
"List of languages the client is able to understand, and which locale variant is preferred."
acceptLanguage: [Locale!]): String
slugAllLocales: [LocalizedString!]
customerRef: Reference
customer: Customer
anonymousId: String
lineItems: [ShoppingListLineItem!]!
textLineItems: [TextLineItem!]!
custom: CustomFieldsType
deleteDaysAfterLastModification: Int
id: String!
version: Long!
createdAt: DateTime!
lastModifiedAt: DateTime!
createdBy: Initiator
lastModifiedBy: Initiator
}
type ShoppingListLineItem {
id: String!
productId: String!
variantId: Int
productTypeRef: Reference!
productType: ProductTypeDefinition!
quantity: Int!
addedAt: DateTime!
name(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
"List of languages the client is able to understand, and which locale variant is preferred."
acceptLanguage: [Locale!]): String
nameAllLocales: [LocalizedString!]!
deactivatedAt: DateTime
custom: CustomFieldsType
productSlug(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
"List of languages the client is able to understand, and which locale variant is preferred."
acceptLanguage: [Locale!]): String
variant: ProductVariant
}
"Fields to access shopping lists. Includes direct access to a single list and searching for shopping lists."
interface ShoppingListQueryInterface {
shoppingList(
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): ShoppingList
shoppingLists(where: String, sort: [String!], limit: Int, offset: Int): ShoppingListQueryResult!
}
type ShoppingListQueryResult {
offset: Int!
count: Int!
total: Long!
results: [ShoppingList!]!
}
type TextLineItem {
id: String!
name(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
"List of languages the client is able to understand, and which locale variant is preferred."
acceptLanguage: [Locale!]): String
nameAllLocales: [LocalizedString!]!
description(
"String is defined for different locales. This argument specifies the desired locale."
locale: Locale,
"List of languages the client is able to understand, and which locale variant is preferred."
acceptLanguage: [Locale!]): String
descriptionAllLocales: [LocalizedString!]
quantity: Int!
custom: CustomFieldsType
addedAt: DateTime!
}