GraphQL new custom fields
The customFields
field on GraphQL queries is deprecated in favor of the new custom
field. customFields
is still available for use in queries, but we strongly encourage all users to switch to using custom
in GraphQL queries. For more information about this change, see Beta Features.
We are deprecating the existing customFields
graphQL field present on all fields having custom fields for a better alternative.
In the new approach, all fields having custom fields have the new custom
field exposes the following sub-fields:
type RawCustomField {name: String!value: Json!}type CustomFieldsType {typeRef: Reference!type: TypeDefinition"This field contains non-typed data. For a typed alternative, have a look at `customFields`."customFieldsRaw(includeNames: [String!],excludeNames: [String!]): [RawCustomField!]"This field contains typed data"customFields: Type!}
The customFields
provides access to typed custom fields.
The new custom
field improves the performance of the query as long as you don't use typed fields. For example:
fragment customFields on ProducePrice {custom {typeRef {id}rawCustomFields {namevalue}}}
If you use custom.customFields
then you won't profit from the better performance.
- [GraphQL API] Added the following types to the GraphQL schema:
CustomFieldsType
. - [GraphQL API] Changed the
Category
type:- Added the
custom
field to theCategory
type. - Field
customFieldsRaw
was deprecated inCategory
type - Field
customFields
was deprecated inCategory
type
- Added the
- [GraphQL API] Changed the
Channel
type:- Added the
custom
field to theChannel
type. - Field
customFields
was deprecated inChannel
type - Field
customFieldsRaw
was deprecated inChannel
type
- Added the
- [GraphQL API] Changed the
ProductPrice
type:- Added the
custom
field to theProductPrice
type. - Field
customFieldsRaw
was deprecated inProductPrice
type - Field
customFields
was deprecated inProductPrice
type
- Added the
- [GraphQL API] Changed the
Cart
type:- Added the
custom
field to theCart
type. - Field
customFieldsRaw
was deprecated inCart
type - Field
customFields
was deprecated inCart
type
- Added the
- [GraphQL API] Changed the
CustomerGroup
type:- Added the
custom
field to theCustomerGroup
type. - Field
customFieldsRaw
was deprecated inCustomerGroup
type - Field
customFields
was deprecated inCustomerGroup
type
- Added the
- [GraphQL API] Changed the
Asset
type:- Added the
custom
field to theAsset
type. - Field
customFields
was deprecated inAsset
type - Field
customFieldsRaw
was deprecated inAsset
type
- Added the
- [GraphQL API] Changed the
CustomLineItem
type:- Added the
custom
field to theCustomLineItem
type. - Field
customFields
was deprecated inCustomLineItem
type - Field
customFieldsRaw
was deprecated inCustomLineItem
type
- Added the
- [GraphQL API] Changed the
Customer
type:- Added the
custom
field to theCustomer
type. - Field
customFieldsRaw
was deprecated inCustomer
type - Field
customFields
was deprecated inCustomer
type
- Added the
- [GraphQL API] Changed the
CartDiscount
type:- Added the
custom
field to theCartDiscount
type. - Field
customFields
was deprecated inCartDiscount
type - Field
customFieldsRaw
was deprecated inCartDiscount
type
- Added the
- [GraphQL API] Changed the
Payment
type:- Added the
custom
field to thePayment
type. - Field
customFieldsRaw
was deprecated inPayment
type - Field
customFields
was deprecated inPayment
type
- Added the
- [GraphQL API] Changed the
CategorySearch
type:- Added the
custom
field to theCategorySearch
type. - Field
customFields
was deprecated inCategorySearch
type - Field
customFieldsRaw
was deprecated inCategorySearch
type
- Added the
- [GraphQL API] Changed the
Order
type:- Added the
custom
field to theOrder
type. - Field
customFieldsRaw
was deprecated inOrder
type - Field
customFields
was deprecated inOrder
type
- Added the
- [GraphQL API] Changed the
InventoryEntry
type:- Added the
custom
field to theInventoryEntry
type. - Field
customFields
was deprecated inInventoryEntry
type - Field
customFieldsRaw
was deprecated inInventoryEntry
type
- Added the
- [GraphQL API] Changed the
LineItem
type:- Added the
custom
field to theLineItem
type. - Field
customFields
was deprecated inLineItem
type - Field
customFieldsRaw
was deprecated inLineItem
type
- Added the
- [GraphQL API] Changed the
DiscountCode
type:- Added the
custom
field to theDiscountCode
type. - Field
customFields
was deprecated inDiscountCode
type - Field
customFieldsRaw
was deprecated inDiscountCode
type
- Added the
Introduced the following changes to the GraphQL schema (in SDL format):
extend type Category {custom: CustomFieldsType}extend type Channel {custom: CustomFieldsType}extend type ProductPrice {custom: CustomFieldsType}extend type Cart {custom: CustomFieldsType}extend type CustomerGroup {custom: CustomFieldsType}extend type Asset {custom: CustomFieldsType}extend type CustomLineItem {custom: CustomFieldsType}extend type Customer {custom: CustomFieldsType}extend type CartDiscount {custom: CustomFieldsType}extend type Payment {custom: CustomFieldsType}extend type CategorySearch {custom: CustomFieldsType}extend type Order {custom: CustomFieldsType}extend type InventoryEntry {custom: CustomFieldsType}extend type LineItem {custom: CustomFieldsType}extend type DiscountCode {custom: CustomFieldsType}type CustomFieldsType {typeRef: Reference!type: TypeDefinition"This field contains non-typed data. For a typed alternative, have a look at `customFields`."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!]"This field contains typed data"customFields: Type!}