diff --git a/_data/toc/extension-best-practices.yml b/_data/toc/extension-best-practices.yml index aa03f0ed65c..f147148d3d9 100644 --- a/_data/toc/extension-best-practices.yml +++ b/_data/toc/extension-best-practices.yml @@ -57,3 +57,6 @@ pages: - label: Creating a Magento admin page url: /ext-best-practices/extension-coding/example-module-adminpage.html + + - label: Creating a dynamic row system config + url: /ext-best-practices/tutorials/dynamic-row-system-config.html diff --git a/guides/v2.3/graphql/develop/resolvers.md b/guides/v2.3/graphql/develop/resolvers.md index cacebf4bc3b..2172ac66c77 100644 --- a/guides/v2.3/graphql/develop/resolvers.md +++ b/guides/v2.3/graphql/develop/resolvers.md @@ -69,6 +69,32 @@ 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 .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\\\\Model\\Resolver\\MutationResolverModel") @doc(description:"Mutation query description") +} +``` + +**Correct approach** + +```text +type Mutation { + mutationQueryName(inputParam: InputParamsType): MutationQueryOutput @resolver(class: "Magento\\\\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 query/mutation class