From 13ea1f8a1b7edc0d3cdb5e9b65abe31109d34511 Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Fri, 14 Jun 2019 10:05:33 -0500 Subject: [PATCH] magento/graphql-ce#741: Add extension point to set custom parameters to Query Context object - added extended docs --- app/code/Magento/CustomerGraphQl/etc/graphql/di.xml | 2 +- .../Model/Query/ContextParametersProcessorInterface.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml b/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml index 961eab2a8320..cb4ab0b7b27f 100644 --- a/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/CustomerGraphQl/etc/graphql/di.xml @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/app/code/Magento/GraphQl/Model/Query/ContextParametersProcessorInterface.php b/app/code/Magento/GraphQl/Model/Query/ContextParametersProcessorInterface.php index e79ffa7f00c7..bcea6383e7fb 100644 --- a/app/code/Magento/GraphQl/Model/Query/ContextParametersProcessorInterface.php +++ b/app/code/Magento/GraphQl/Model/Query/ContextParametersProcessorInterface.php @@ -8,7 +8,12 @@ namespace Magento\GraphQl\Model\Query; /** - * Extension point for adding custom parameters to context object + * Adding custom parameters to context object: + * + * - Add new contextParametersProcessors item to ContextFactory in the di.xml. + * - Class must extend ContextParametersProcessorInterface. + * - Implement execute method which adds additional data to the context though extension attributes. + * - This data will be present in each resolver. */ interface ContextParametersProcessorInterface {