Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit e959d52

Browse files
authored
Merge pull request #7001 from magento/kh_mutation-syntax
GraphQL: Remove section from resolvers topic
2 parents 35f7a0f + a7fe70f commit e959d52

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/guides/v2.3/graphql/develop/resolvers.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -221,32 +221,6 @@ Syntax option | Description
221221
`@doc(description)` | Describes the purpose of the mutation
222222
`@deprecated(reason: "description")` | Use `@deprecated` to mark a query, mutation, or attribute as deprecated
223223

224-
{:.bs-callout-tip}
225-
It is a good practice to define separate types for input and output data. This practice permits additional extension points, so every input and output type can be extended by adding additional fields to the definition.
226-
227-
#### Example
228-
229-
**Wrong approach:**
230-
231-
```text
232-
type Mutation {
233-
mutationQueryName(param1: String, param2: Int, ...): MutationQueryOutput @resolver(class: "Magento\\<module_name>\\Model\\Resolver\\MutationResolverModel") @doc(description:"Mutation query description")
234-
}
235-
```
236-
237-
**Correct approach:**
238-
239-
```text
240-
type Mutation {
241-
mutationQueryName(inputParam: InputParamsType): MutationQueryOutput @resolver(class: "Magento\\<module_name>\\Model\\Resolver\\MutationResolverModel") @doc(description:"Mutation query description")
242-
}
243-
244-
type InputParamsType {
245-
param1: String
246-
param2: Int
247-
}
248-
```
249-
250224
### Resolver class
251225

252226
Use the following sample code as a template for the GraphQL resolver mutation class:

0 commit comments

Comments
 (0)