Skip to content

Update custom context class option to be compatible with new GraphQLContext class #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 4, 2021

Conversation

oryan-block
Copy link
Collaborator

@oryan-block oryan-block commented Aug 17, 2021

Also minimize use of deprecated APIs.

Checklist

  • Pull requests follows the contribution guide
  • New or modified functionality is covered by tests

Description

Following graphql-java/graphql-java#2368 the custom context class option is deprecated in GraphQL Java, this PR does the same for Tools by using the "official" GraphQLContext class and deprecating the contextClass option.

The contextClass option is still available as a value in the new context object with the context class as the key:
Clients that want to keep using this option will have to adjust accordingly:

var executionInput = ExecutionInput.newExecutionInput()
            .query(query)
            .variables(variables)
            .graphQLContext(Map.of(CustomContext.class, context));

environment.<GraphQLContext>getContext(); -> environment.getGraphQLContext().<CustomContext>get(CustomContext.class);

And minimize use of deprecated api
@vojtapol vojtapol changed the title Deprecate costume context class option Deprecate custom context class option Aug 17, 2021
@oryan-block oryan-block changed the title Deprecate custom context class option Update custom context class option to be compatible with new GraphQLContext class Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants