All Release Notes
Category and Product Mutations added
2 October 2018
Composable Commerce
HTTP API
Enhancement
GraphQLProduct catalog
It is now possible to create/update/delete categories as well as products via GraphQL API.
- [GraphQL API] Type
Mutation
was changed:- Field
createCategory
was added toMutation
type - Field
updateCategory
was added toMutation
type - Field
deleteCategory
was added toMutation
type - Field
createProduct
was added toMutation
type - Field
updateProduct
was added toMutation
type - Field
deleteProduct
was added toMutation
type
- Field
Additionally the following query fields where added:
[GraphQL API] Type
Category
was changed:- Field
assets
was added toCategory
type
- Field
[GraphQL API] Type
ProductVariant
was changed:- Field
assets
was added toProductVariant
type
- Field
[GraphQL API] Type
ProductPrice
was changed:- Field
tiers
was added toProductPrice
type
- Field
Following changes were introduced in the GraphQL schema:
- only a subset is shown
- changes are shown in GraphQL Schema Definition Language
extend type Mutation {createCategory(draft: CategoryDraft!): CategoryupdateCategory("Queries with specified ID"id: String,"Queries with specified key"key: String, version: Long!, actions: [CategoryUpdateAction!]!): CategorydeleteCategory("Queries with specified ID"id: String,"Queries with specified key"key: String, version: Long!): CategorycreateProduct(draft: ProductDraft!): ProductupdateProduct("Queries with specified ID"id: String,"Queries with specified key"key: String, version: Long!, actions: [ProductUpdateAction!]!): ProductdeleteProduct("Queries with specified ID"id: String,"Queries with specified key"key: String, version: Long!): Product}input CategoryUpdateAction {addAsset: AddCategoryAssetchangeAssetName: ChangeCategoryAssetNamechangeAssetOrder: ChangeCategoryAssetOrderchangeName: ChangeCategoryNamechangeOrderHint: ChangeCategoryOrderHintchangeSlug: ChangeCategorySlugchangeParent: ChangeCategoryParentremoveAsset: RemoveCategoryAssetsetAssetCustomField: SetCategoryAssetCustomFieldsetAssetCustomType: SetCategoryAssetCustomTypesetAssetDescription: SetCategoryAssetDescriptionsetAssetKey: SetCategoryAssetKeysetAssetSources: SetCategoryAssetSourcessetAssetTags: SetCategoryAssetTagssetCustomField: SetCategoryCustomFieldsetCustomType: SetCategoryCustomTypesetDescription: SetCategoryDescriptionsetKey: SetCategoryKeysetMetaDescription: SetCategoryMetaDescriptionsetMetaKeywords: SetCategoryMetaKeywordssetMetaTitle: SetCategoryMetaTitlesetExternalId: SetCategoryExternalId}input ProductUpdateAction {moveImageToPosition: MoveProductImageToPositionsetSearchKeywords: SetSearchKeywordsrevertStagedChanges: RevertStagedChangesrevertStagedVariantChanges: RevertStagedVariantChangespublish: PublishProductunpublish: UnpublishProducttransitionState: TransitionProductStateaddAsset: AddProductAssetaddExternalImage: AddProductExternalImageaddPrice: AddProductPriceaddToCategory: AddProductToCategoryaddVariant: AddProductVariantchangeAssetName: ChangeProductAssetNamechangeAssetOrder: ChangeProductAssetOrderchangeMasterVariant: ChangeProductMasterVariantchangeImageLabel: ChangeProductImageLabelchangeName: ChangeProductNamechangePrice: ChangeProductPricechangeSlug: ChangeProductSlugremoveAsset: RemoveProductAssetremoveFromCategory: RemoveProductFromCategoryremoveImage: RemoveProductImageremovePrice: RemoveProductPriceremoveVariant: RemoveProductVariantsetAssetCustomField: SetProductAssetCustomFieldsetAssetCustomType: SetProductAssetCustomTypesetAssetDescription: SetProductAssetDescriptionsetAssetKey: SetProductAssetKeysetAssetSources: SetProductAssetSourcessetAssetTags: SetProductAssetTagssetCategoryOrderHint: SetProductCategoryOrderHintsetDiscountedPrice: SetProductDiscountedPricesetAttribute: SetProductAttributesetAttributeInAllVariants: SetProductAttributeInAllVariantssetDescription: SetProductDescriptionsetImageLabel: SetProductImageLabelsetKey: SetProductKeysetMetaAttributes: SetProductMetaAttributessetMetaDescription: SetProductMetaDescriptionsetMetaKeywords: SetProductMetaKeywordssetMetaTitle: SetProductMetaTitlesetProductPriceCustomField: SetProductPriceCustomFieldsetProductPriceCustomType: SetProductPriceCustomTypesetPrices: SetProductPricessetSku: SetProductSkusetTaxCategory: SetProductTaxCategorysetProductVariantKey: SetProductVariantKey}extend type ProductVariant {assets: [Asset!]!}extend type Category {assets: [Asset!]!}type Asset {id: String!key: Stringsources: [AssetSource!]!name("String is define 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!]): StringnameAllLocales: [LocalizedString!]!description(locale: Locale,acceptLanguage: [Locale!]): StringdescriptionAllLocales: [LocalizedString!]tags: [String!]!}type AssetSource {uri: String!key: Stringdimensions: AssetDimensionscontentType: String}type AssetDimensions {width: Int!height: Int!}