-
Notifications
You must be signed in to change notification settings - Fork 96
Graphql java 12 #209
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
Graphql java 12 #209
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…, we are now adding it to the code registry
Changed GraphQLAnnotations to be not static GraphQLCodeRegistry.Builder is now encapsulated inside ProcessingElementsContainer
Notice that the client should also provide page info in order for it to work properly
added setRelay method to the schema creator
osher-sade
approved these changes
Apr 30, 2019
src/main/java/graphql/annotations/AnnotationsSchemaCreator.java
Outdated
Show resolved
Hide resolved
src/main/java/graphql/annotations/AnnotationsSchemaCreator.java
Outdated
Show resolved
Hide resolved
src/main/java/graphql/annotations/AnnotationsSchemaCreator.java
Outdated
Show resolved
Hide resolved
src/main/java/graphql/annotations/processor/typeBuilders/UnionBuilder.java
Show resolved
Hide resolved
DoctorVoid
reviewed
May 1, 2019
src/test/java/graphql/annotations/AnnotationsSchemaCreatorTest.java
Outdated
Show resolved
Hide resolved
DoctorVoid
reviewed
May 2, 2019
src/main/java/graphql/annotations/processor/util/CodeRegistryUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/graphql/annotations/processor/util/CodeRegistryUtil.java
Outdated
Show resolved
Hide resolved
src/test/java/graphql/annotations/AnnotationsSchemaCreatorTest.java
Outdated
Show resolved
Hide resolved
src/test/java/graphql/annotations/AnnotationsSchemaCreatorTest.java
Outdated
Show resolved
Hide resolved
guy120494
approved these changes
May 3, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solving #206
This PR intends to work with new GraphQL-Java 12.
In their new version, graphql-java broke their API completely and now Data Fetching and Type Resolving are separated from the GraphQL type objects into a new
GraphQLCodeRegistry
.In this PR, we have refactored the way we handle data fetching and type resolving in graphql-java-annotations.
GraphQLCodeRegistry.Builder
is now encapsulated inside theGraphQLAnnotations
object, so that in every place we previously went accross some data fetcher/type resolver and added it to the graphql object, we now add it to the code registry builder instead.Then, when building the schema, it will be necessary to not only provide the object built by GraphQLAnnotations, but also provide the GraphQLCodeRegistry (so it needs to be taken from the GraphQLAnnotations object, to be built, and then provided to the GraphQLSchema Builder).
To make things easier, a new class called
AnnotationsSchema
is now providing a builder class to help you create your schema without the need of handling the code registry. You can simply callquery
,mutation
,directive
, etc, methods - and provide them with the class you want to build a GraphQL Object from.For example:
A breaking change in this PR is that GraphQLAnnotations is not a singletone anymore. You should instatiate a GraphQLAnnotations object in order to use it to build your graphql objects (or use the static AnnotationsSchema.Builder).