docs icon indicating copy to clipboard operation
docs copied to clipboard

No example for renaming subscription operations and the significance of the different format

Open SalmonMode opened this issue 2 years ago • 0 comments

Describe the content issue: It looks like the structure for how to define custom operation names for subscriptions is different than mutations and queries, as the docs highlight:

input ModelMutationMap {
  create: String
  update: String
  delete: String
}

input ModelQueryMap {
  get: String
  list: String
}

input ModelSubscriptionMap {
  onCreate: [String]
  onUpdate: [String]
  onDelete: [String]
  level: ModelSubscriptionLevel
}

The subscriptions take an array of strings while the others take standalone strings, but why it's different and how to leverage it is unclear. Should it be a single string inside the array, making it something like this by default onUpdate: "onUpdate{TypeName}"? Are more names per operation supported? Or is it just a quirk of how GraphQL directives must be made that it has to be an array and we should only include a single entry?

URL page where content issue is: https://docs.amplify.aws/react/build-a-backend/graphqlapi/data-modeling/

SalmonMode avatar Nov 28 '23 15:11 SalmonMode