Platform Release 9 March 2020

Reviews can now be queried, created, updated and deleted using the GraphQL API.

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): Review
  reviews(where: String, sort: [String!], limit: Int, offset: Int): ReviewQueryResult!
}

type Review implements Versioned {
  key: String
  uniquenessValue: String
  locale: Locale
  authorName: String
  title: String
  text: String
  targetRef: Reference
  target: ReviewTarget
  rating: Int
  stateRef: Reference
  state: State
  includedInStatistics: Boolean!
  customerRef: Reference
  customer: Customer
  custom: CustomFieldsType
  id: String!
  version: Long!
  createdAt: DateTime!
  lastModifiedAt: DateTime!
  createdBy: Initiator
  lastModifiedBy: Initiator
}

type ReviewQueryResult {
  offset: Int!
  count: Int!
  total: Long!
  results: [Review!]!
}

interface ReviewTarget {
  id: String!
}

extend type Mutation {
  createReview(draft: ReviewDraft!): Review
  deleteReview(version: Long!,

    "Queries with specified ID"
    id: String,

    "Queries with specified key"
    key: String): Review
  updateReview(version: Long!, actions: [ReviewUpdateAction!]!,

    "Queries with specified ID"
    id: String,

    "Queries with specified key"
    key: String): Review
}

input ReviewDraft {
  key: String
  uniquenessValue: String
  locale: Locale
  authorName: String
  title: String
  text: String
  target: TargetReferenceInput
  state: ResourceIdentifierInput
  rating: Int
  customer: ResourceIdentifierInput
  custom: CustomFieldsDraft
}

input ReviewUpdateAction {
  setAuthorName: SetReviewAuthorName
  setCustomField: SetReviewCustomField
  setCustomType: SetReviewCustomType
  setCustomer: SetReviewCustomer
  setKey: SetReviewKey
  setLocale: SetReviewLocale
  setRating: SetReviewRating
  setTarget: SetReviewTarget
  setText: SetReviewText
  setTitle: SetReviewTitle
  transitionState: TransitionReviewState
}

input SetReviewAuthorName {
  authorName: String
}

input SetReviewCustomField {
  name: String!
  value: String
}

input SetReviewCustomType {
  fields: [CustomFieldInput!]
  type: ResourceIdentifierInput
  typeKey: String
  typeId: 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: String
  key: String
}

input TransitionReviewState {
  state: ResourceIdentifierInput!
  force: Boolean = false
}