All Release Notes

Added exists operator to GraphQL API

23 September 2021
Composable Commerce
HTTP API
Enhancement
GraphQL

To improve the developer experience for you we have added an exists operator to our GraphQL API. This improvement to the API design is now the recommended way of checking the existence of query results because

  1. it optimizes the query resulting in shorter response times and
  2. it avoids you finding workarounds with other query fields to achieve the same.

Changes:

  • [GraphQL API] Added the Boolean exists field to all QueryResult types.

The following changes were introduced in terms of GraphQL SDL:

extend type ChannelQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ProductSearchVariantAvailability {
id: String
version: Long
}
extend type StateQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type TaxCategoryQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ProductTypeDefinitionQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type APIClientWithoutSecretQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type MyPaymentQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type CartDiscountQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type CustomerQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ShippingMethodQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ProductQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type DiscountCodeQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type PaymentQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ReviewQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ProductDiscountQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type CustomObjectQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type MessageQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type CustomerGroupQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ProductVariantAvailability {
id: String
version: Long
}
extend type CommercetoolsSubscriptionQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type InventoryEntryQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type CategoryQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type StoreQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type TypeDefinitionQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type OrderQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type OrderEditQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type CartQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ExtensionQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ShoppingListQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}
extend type ZoneQueryResult {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
exists: Boolean!
}