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
44
44
UserContext contextForUser = YourGraphqlContextBuilder . getContextForUser(getCurrentUser());
45
45
46
46
ExecutionInput executionInput = ExecutionInput . newExecutionInput()
47
- .context( contextForUser)
47
+ .graphQLContext( context - > context . put( " userContext " , contextForUser) )
48
48
.build();
49
49
50
50
ExecutionResult executionResult = graphQL. execute(executionInput);
@@ -57,7 +57,7 @@ ExecutionResult executionResult = graphQL.execute(executionInput);
57
57
DataFetcher dataFetcher = new DataFetcher () {
58
58
@Override
59
59
public Object get (DataFetchingEnvironment environment ) {
60
- UserContext userCtx = environment. getContext( );
60
+ UserContext userCtx = environment. getGraphQlContext() . get( " userContext " );
61
61
Long businessObjId = environment. getArgument(" businessObjId" );
62
62
63
63
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
44
44
UserContext contextForUser = YourGraphqlContextBuilder . getContextForUser(getCurrentUser());
45
45
46
46
ExecutionInput executionInput = ExecutionInput . newExecutionInput()
47
- .context( contextForUser)
47
+ .graphQLContext( context - > context . put( " userContext " , contextForUser) )
48
48
.build();
49
49
50
50
ExecutionResult executionResult = graphQL. execute(executionInput);
@@ -57,7 +57,7 @@ ExecutionResult executionResult = graphQL.execute(executionInput);
57
57
DataFetcher dataFetcher = new DataFetcher () {
58
58
@Override
59
59
public Object get (DataFetchingEnvironment environment ) {
60
- UserContext userCtx = environment. getContext( );
60
+ UserContext userCtx = environment. getGraphQlContext() . get( " userContext " );
61
61
Long businessObjId = environment. getArgument(" businessObjId" );
62
62
63
63
return invokeBusinessLayerMethod(userCtx, businessObjId);
You can’t perform that action at this time.
0 commit comments