File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
versioned_docs/version-v22 Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ This made up example shows how you can pass yourself information to help execute
4444UserContext contextForUser = YourGraphqlContextBuilder . getContextForUser(getCurrentUser());
4545
4646ExecutionInput executionInput = ExecutionInput . newExecutionInput()
47- .context( contextForUser)
47+ .graphQLContext( context - > context . put( " userContext " , contextForUser) )
4848 .build();
4949
5050ExecutionResult executionResult = graphQL. execute(executionInput);
@@ -57,7 +57,7 @@ ExecutionResult executionResult = graphQL.execute(executionInput);
5757DataFetcher dataFetcher = new DataFetcher () {
5858 @Override
5959 public Object get (DataFetchingEnvironment environment ) {
60- UserContext userCtx = environment. getContext( );
60+ UserContext userCtx = environment. getGraphQlContext() . get( " userContext " );
6161 Long businessObjId = environment. getArgument(" businessObjId" );
6262
6363 return invokeBusinessLayerMethod(userCtx, businessObjId);
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ This made up example shows how you can pass yourself information to help execute
4444UserContext contextForUser = YourGraphqlContextBuilder . getContextForUser(getCurrentUser());
4545
4646ExecutionInput executionInput = ExecutionInput . newExecutionInput()
47- .context( contextForUser)
47+ .graphQLContext( context - > context . put( " userContext " , contextForUser) )
4848 .build();
4949
5050ExecutionResult executionResult = graphQL. execute(executionInput);
@@ -57,7 +57,7 @@ ExecutionResult executionResult = graphQL.execute(executionInput);
5757DataFetcher dataFetcher = new DataFetcher () {
5858 @Override
5959 public Object get (DataFetchingEnvironment environment ) {
60- UserContext userCtx = environment. getContext( );
60+ UserContext userCtx = environment. getGraphQlContext() . get( " userContext " );
6161 Long businessObjId = environment. getArgument(" businessObjId" );
6262
6363 return invokeBusinessLayerMethod(userCtx, businessObjId);
You can’t perform that action at this time.
0 commit comments