Commit b5a642ab authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'eread/minor-edit-of-graphql-section' into 'master'

Minor edit of new content

See merge request gitlab-org/gitlab!34806
parents 07c54b1c bb7587fc
...@@ -717,8 +717,7 @@ will be returned as the result of the mutation. ...@@ -717,8 +717,7 @@ will be returned as the result of the mutation.
### Naming conventions ### Naming conventions
Each mutation must define a `graphql_name`, which is the name of the Each mutation must define a `graphql_name`, which is the name of the mutation in the GraphQL schema.
mutation in the GraphQL schema.
Example: Example:
...@@ -728,9 +727,8 @@ class UserUpdateMutation < BaseMutation ...@@ -728,9 +727,8 @@ class UserUpdateMutation < BaseMutation
end end
``` ```
Our GraphQL mutation names are historically inconsistent, but new Our GraphQL mutation names are historically inconsistent, but new mutation names should follow the
mutation names should follow the convention `'{Resource}{Action}'` convention `'{Resource}{Action}'` or `'{Resource}{Action}{Attribute}'`.
or `'{Resource}{Action}{Attribute}'`.
Mutations that **create** new resources should use the verb `Create`. Mutations that **create** new resources should use the verb `Create`.
...@@ -738,9 +736,10 @@ Example: ...@@ -738,9 +736,10 @@ Example:
- `CommitCreate` - `CommitCreate`
Mutations that **update** data should use the verb `Update` or a Mutations that **update** data should use:
domain-specific verb like `Set`, `Add`, or `Toggle` if more
appropriate. - The verb `Update`.
- A domain-specific verb like `Set`, `Add`, or `Toggle` if more appropriate.
Examples: Examples:
...@@ -749,17 +748,17 @@ Examples: ...@@ -749,17 +748,17 @@ Examples:
- `IssueUpdate` - `IssueUpdate`
- `TodoMarkDone` - `TodoMarkDone`
Mutations that **remove** data should use the verb `Delete` rather than Mutations that **remove** data should use:
`Destroy`. Or use a domain-specific verb like `Remove` if more
appropriate. - The verb `Delete` rather than `Destroy`.
- A domain-specific verb like `Remove` if more appropriate.
Examples: Examples:
- `AwardEmojiRemove` - `AwardEmojiRemove`
- `NoteDelete` - `NoteDelete`
If you need advice for mutation naming, canvass the Slack `#graphql` If you need advice for mutation naming, canvass the Slack `#graphql` channel for feedback.
channel for feedback.
### Arguments ### Arguments
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment