From 51e5bc3f24a8bb090070ba61261eefb3b8cff78b Mon Sep 17 00:00:00 2001 From: eduard13 Date: Sun, 23 Jun 2019 10:37:42 +0300 Subject: [PATCH 1/2] Adding the missing menu item for the topic --- _data/toc/extension-best-practices.yml | 3 +++ 1 file changed, 3 insertions(+) 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 From a30fd8c92b24062e74ea445b64988aa287f380e0 Mon Sep 17 00:00:00 2001 From: Alexander Taranovsky Date: Tue, 25 Jun 2019 19:00:29 +0300 Subject: [PATCH 2/2] magento/devdocs#: Resolvers. Add a tip about input/output types (#4331) * magento/devdocs#: Resolvers. Add a tip about input/output types * magento/devdocs#: Resolvers. Add a tip about input/output types * magento/devdocs#: Resolvers. Add a tip about input/output types --- guides/v2.3/graphql/develop/resolvers.md | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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