All Release Notes
Added Review GraphQL query and mutation schema
9 March 2020
Composable Commerce
HTTP API
Enhancement
GraphQLProduct catalogSearch
Reviews can now be queried, created, updated, and deleted using the GraphQL API.
- [GraphQL API] Added the following types to the GraphQL schema:
Review
,ReviewQueryResult
,ReviewTarget
,ReviewDraft
,ReviewUpdateAction
,SetReviewAuthorName
,SetReviewCustomField
,SetReviewCustomType
,SetReviewCustomer
,SetReviewKey
,SetReviewLocale
,SetReviewRating
,SetReviewTarget
,SetReviewText
,SetReviewTitle
,TargetReferenceInput
,TransitionReviewState
. - [GraphQL API] Changed the
Channel
type:Channel
object type now implementsReviewTarget
interface
- [GraphQL API] Changed the
Product
type:Product
object type now implementsReviewTarget
interface
- [GraphQL API] Changed the
Query
type:- Added the
reviews
field to theQuery
type. - Added the
review
field to theQuery
type.
- Added the
- [GraphQL API] Changed the
Mutation
type:- Added the
updateReview
field to theMutation
type. - Added the
deleteReview
field to theMutation
type. - Added the
createReview
field to theMutation
type.
- Added the
Introduced the following changes to the GraphQL schema (in SDL format):
extend type Query {review("Queries with specified ID"id: String,"Queries with specified key"key: String): Reviewreviews(where: String, sort: [String!], limit: Int, offset: Int): ReviewQueryResult!}type Review implements Versioned {key: StringuniquenessValue: Stringlocale: LocaleauthorName: Stringtitle: Stringtext: StringtargetRef: Referencetarget: ReviewTargetrating: IntstateRef: Referencestate: StateincludedInStatistics: Boolean!customerRef: Referencecustomer: Customercustom: CustomFieldsTypeid: String!version: Long!createdAt: DateTime!lastModifiedAt: DateTime!createdBy: InitiatorlastModifiedBy: Initiator}type ReviewQueryResult {offset: Int!count: Int!total: Long!results: [Review!]!}interface ReviewTarget {id: String!}extend type Mutation {createReview(draft: ReviewDraft!): ReviewdeleteReview(version: Long!,"Queries with specified ID"id: String,"Queries with specified key"key: String): ReviewupdateReview(version: Long!, actions: [ReviewUpdateAction!]!,"Queries with specified ID"id: String,"Queries with specified key"key: String): Review}input ReviewDraft {key: StringuniquenessValue: Stringlocale: LocaleauthorName: Stringtitle: Stringtext: Stringtarget: TargetReferenceInputstate: ResourceIdentifierInputrating: Intcustomer: ResourceIdentifierInputcustom: CustomFieldsDraft}input ReviewUpdateAction {setAuthorName: SetReviewAuthorNamesetCustomField: SetReviewCustomFieldsetCustomType: SetReviewCustomTypesetCustomer: SetReviewCustomersetKey: SetReviewKeysetLocale: SetReviewLocalesetRating: SetReviewRatingsetTarget: SetReviewTargetsetText: SetReviewTextsetTitle: SetReviewTitletransitionState: TransitionReviewState}input SetReviewAuthorName {authorName: String}input SetReviewCustomField {name: String!value: String}input SetReviewCustomType {fields: [CustomFieldInput!]type: ResourceIdentifierInputtypeKey: StringtypeId: String}input SetReviewCustomer {customer: ResourceIdentifierInput}input SetReviewKey {key: String}input SetReviewLocale {locale: Locale}input SetReviewRating {rating: Int}input SetReviewTarget {target: TargetReferenceInput}input SetReviewText {text: String}input SetReviewTitle {title: String}input TargetReferenceInput {typeId: String!id: Stringkey: String}input TransitionReviewState {state: ResourceIdentifierInput!force: Boolean = false}