aws-amplify / aws-amplify/docs

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

Open
#6,565 0 comments 0 reactions 0 assignees View on GitHub
amplify/data theme:data-schema
Dominant language
MDX
Stars
506
Forks
1.1k
Avg merge
3h 14m
Merged PRs (30d)
1

Description

**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:

```graphql
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/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.