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

GraphQL: Remove section from resolvers topic #7001

Merged
merged 2 commits into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions src/guides/v2.3/graphql/develop/resolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,32 +221,6 @@ Syntax option | Description
`@doc(description)` | Describes the purpose of the mutation
`@deprecated(reason: "description")` | Use `@deprecated` to mark a query, mutation, or attribute as deprecated

{:.bs-callout-tip}
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.

#### Example

**Wrong approach:**

```text
type Mutation {
mutationQueryName(param1: String, param2: Int, ...): MutationQueryOutput @resolver(class: "Magento\\<module_name>\\Model\\Resolver\\MutationResolverModel") @doc(description:"Mutation query description")
}
```

**Correct approach:**

```text
type Mutation {
mutationQueryName(inputParam: InputParamsType): MutationQueryOutput @resolver(class: "Magento\\<module_name>\\Model\\Resolver\\MutationResolverModel") @doc(description:"Mutation query description")
}

type InputParamsType {
param1: String
param2: Int
}
```

### Resolver class

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