GraphQLBundle icon indicating copy to clipboard operation
GraphQLBundle copied to clipboard

control public fields based on contextValue passed to executor

Open videni opened this issue 6 years ago • 2 comments

the fields I need to show clients are dynamic based on executor contextValue

example

privateData:
    type: PrivateType
    public: '@=context["schema"] in ["admin"]'

the key schema above is injected via Events::PRE_EXECUTOR event.

videni avatar Nov 01 '19 07:11 videni

it seems this need lots of change, so does webonyx/graphql-php . Can we collect schema types aware of contextValue parameter passed to executor

videni avatar Nov 01 '19 10:11 videni

the easiest way I can think is to inject the contextValue into the $globalVariable.

create a custom synthetic service to which the contextValue wil be injected, then save this service into the GlobalVariables service.

videni avatar Nov 01 '19 10:11 videni