diff --git a/README.md b/README.md index ead1bfbb..0e3d71b8 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,20 @@ Relay [specification for mutations](https://facebook.github.io/relay/graphql/mut ### Connection -You can use `@GraphQLConnection` annotation to make a field iterable in adherence to Relay [Connection specification](https://facebook.github.io/relay/graphql/connections.htm). +You can use `@GraphQLConnection` annotation to make a field iterable in adherence to Relay [Connection specification](https://facebook.github.io/relay/graphql/connections.htm).\ +If a field is annotated with the annotation, the associated dataFetcher must return an instance of `PaginatedData`.\ +The `PaginatedData` class holds the result of the connection: +1. The data of the page +2. Whether or not there is a next page and a previous page +3. A method that returns for each entity the encoded cursor of the entity (it returns string) + +For you convenience, there is `AbstractPaginatedData` that can be extended. + +If you want to use you own implementation of connection, that's fine, just give a value to connection().\ +Please note that if you do so, you also have to specify your own connection validator that implements `ConnectionValidator`\ +(and should throw `@GraphQLConnectionException` if something is wrong) + +NOTE: because `PropertyDataFetcher` and `FieldDataFetcher` can't handle connection, this annotation cant be used on a field that doesn't have a dataFetcher ### Customizing Relay schema diff --git a/build.gradle b/build.gradle index 8287cf28..0cf45b4d 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,6 @@ idea { vcs = 'Git' } } - release { tagTemplate = 'v${version}' failOnPublishNeeded = false @@ -152,12 +151,12 @@ bintray { vcsUrl = 'https://github.com/graphql-java/graphql-java-annotations' version { name = project.version - released = new Date() + released = new Date() } } } task bundle(type: Bundle) { - from sourceSets.main.output - bndfile = file('bundle.bnd') + from sourceSets.main.output + bndfile = file('bundle.bnd') } diff --git a/out/production/classes/graphql/annotations/GraphQLFieldDefinitionWrapper.class b/out/production/classes/graphql/annotations/GraphQLFieldDefinitionWrapper.class new file mode 100644 index 00000000..a3f15a52 Binary files /dev/null and b/out/production/classes/graphql/annotations/GraphQLFieldDefinitionWrapper.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLBatched.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLBatched.class new file mode 100644 index 00000000..bea66c1b Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLBatched.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLDataFetcher.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDataFetcher.class new file mode 100644 index 00000000..7bc9be3c Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDataFetcher.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLDefaultValue.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDefaultValue.class new file mode 100644 index 00000000..75041b54 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDefaultValue.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLDeprecate.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDeprecate.class new file mode 100644 index 00000000..9a2ecc17 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDeprecate.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLDescription.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDescription.class new file mode 100644 index 00000000..3e2e3481 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLDescription.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLField.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLField.class new file mode 100644 index 00000000..3af6ef63 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLField.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLID.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLID.class new file mode 100644 index 00000000..ee5f66fc Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLID.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLInvokeDetached.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLInvokeDetached.class new file mode 100644 index 00000000..0f14b7d8 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLInvokeDetached.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLMutation.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLMutation.class new file mode 100644 index 00000000..d716396c Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLMutation.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLName.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLName.class new file mode 100644 index 00000000..31e0a45d Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLName.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLNonNull.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLNonNull.class new file mode 100644 index 00000000..3ca99b73 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLNonNull.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLRelayMutation.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLRelayMutation.class new file mode 100644 index 00000000..6a394492 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLRelayMutation.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLType.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLType.class new file mode 100644 index 00000000..c20e0964 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLType.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLTypeExtension.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLTypeExtension.class new file mode 100644 index 00000000..719a214d Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLTypeExtension.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLTypeResolver.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLTypeResolver.class new file mode 100644 index 00000000..6ad01b4e Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLTypeResolver.class differ diff --git a/out/production/classes/graphql/annotations/annotationTypes/GraphQLUnion.class b/out/production/classes/graphql/annotations/annotationTypes/GraphQLUnion.class new file mode 100644 index 00000000..15416a69 Binary files /dev/null and b/out/production/classes/graphql/annotations/annotationTypes/GraphQLUnion.class differ diff --git a/out/production/classes/graphql/annotations/connection/AbstractPaginatedData.class b/out/production/classes/graphql/annotations/connection/AbstractPaginatedData.class new file mode 100644 index 00000000..c730a0e9 Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/AbstractPaginatedData.class differ diff --git a/out/production/classes/graphql/annotations/connection/ConnectionDataFetcher.class b/out/production/classes/graphql/annotations/connection/ConnectionDataFetcher.class new file mode 100644 index 00000000..1515dbb4 Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/ConnectionDataFetcher.class differ diff --git a/out/production/classes/graphql/annotations/connection/ConnectionFetcher.class b/out/production/classes/graphql/annotations/connection/ConnectionFetcher.class new file mode 100644 index 00000000..304d1ac0 Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/ConnectionFetcher.class differ diff --git a/out/production/classes/graphql/annotations/connection/ConnectionValidator.class b/out/production/classes/graphql/annotations/connection/ConnectionValidator.class new file mode 100644 index 00000000..cd4148c7 Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/ConnectionValidator.class differ diff --git a/out/production/classes/graphql/annotations/connection/GraphQLConnection.class b/out/production/classes/graphql/annotations/connection/GraphQLConnection.class new file mode 100644 index 00000000..76e6313a Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/GraphQLConnection.class differ diff --git a/out/production/classes/graphql/annotations/connection/GraphQLConnectionException.class b/out/production/classes/graphql/annotations/connection/GraphQLConnectionException.class new file mode 100644 index 00000000..ab6a6454 Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/GraphQLConnectionException.class differ diff --git a/out/production/classes/graphql/annotations/connection/PaginatedData.class b/out/production/classes/graphql/annotations/connection/PaginatedData.class new file mode 100644 index 00000000..8b417abb Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/PaginatedData.class differ diff --git a/out/production/classes/graphql/annotations/connection/PaginatedDataConnectionFetcher.class b/out/production/classes/graphql/annotations/connection/PaginatedDataConnectionFetcher.class new file mode 100644 index 00000000..1e4a4339 Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/PaginatedDataConnectionFetcher.class differ diff --git a/out/production/classes/graphql/annotations/connection/PaginatedDataConnectionTypeValidator.class b/out/production/classes/graphql/annotations/connection/PaginatedDataConnectionTypeValidator.class new file mode 100644 index 00000000..15b6ff87 Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/PaginatedDataConnectionTypeValidator.class differ diff --git a/out/production/classes/graphql/annotations/connection/SimplePaginatedData.class b/out/production/classes/graphql/annotations/connection/SimplePaginatedData.class new file mode 100644 index 00000000..c913c87d Binary files /dev/null and b/out/production/classes/graphql/annotations/connection/SimplePaginatedData.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/BatchedMethodDataFetcher.class b/out/production/classes/graphql/annotations/dataFetchers/BatchedMethodDataFetcher.class new file mode 100644 index 00000000..8e0c85e7 Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/BatchedMethodDataFetcher.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/ExtensionDataFetcherWrapper.class b/out/production/classes/graphql/annotations/dataFetchers/ExtensionDataFetcherWrapper.class new file mode 100644 index 00000000..bebf2078 Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/ExtensionDataFetcherWrapper.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/MethodDataFetcher.class b/out/production/classes/graphql/annotations/dataFetchers/MethodDataFetcher.class new file mode 100644 index 00000000..0f457f57 Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/MethodDataFetcher.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/RelayMutationMethodDataFetcher.class b/out/production/classes/graphql/annotations/dataFetchers/RelayMutationMethodDataFetcher.class new file mode 100644 index 00000000..d6992598 Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/RelayMutationMethodDataFetcher.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/connection/Connection.class b/out/production/classes/graphql/annotations/dataFetchers/connection/Connection.class new file mode 100644 index 00000000..5002d7ea Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/connection/Connection.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/connection/ConnectionDataFetcher.class b/out/production/classes/graphql/annotations/dataFetchers/connection/ConnectionDataFetcher.class new file mode 100644 index 00000000..3306dc21 Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/connection/ConnectionDataFetcher.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/connection/DispatchingConnection.class b/out/production/classes/graphql/annotations/dataFetchers/connection/DispatchingConnection.class new file mode 100644 index 00000000..92b1ced1 Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/connection/DispatchingConnection.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/connection/ListConnection.class b/out/production/classes/graphql/annotations/dataFetchers/connection/ListConnection.class new file mode 100644 index 00000000..7def8b5d Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/connection/ListConnection.class differ diff --git a/out/production/classes/graphql/annotations/dataFetchers/connection/StreamConnection.class b/out/production/classes/graphql/annotations/dataFetchers/connection/StreamConnection.class new file mode 100644 index 00000000..f3d4f92b Binary files /dev/null and b/out/production/classes/graphql/annotations/dataFetchers/connection/StreamConnection.class differ diff --git a/out/production/classes/graphql/annotations/processor/GraphQLAnnotations.class b/out/production/classes/graphql/annotations/processor/GraphQLAnnotations.class new file mode 100644 index 00000000..b16da095 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/GraphQLAnnotations.class differ diff --git a/out/production/classes/graphql/annotations/processor/ProcessingElementsContainer.class b/out/production/classes/graphql/annotations/processor/ProcessingElementsContainer.class new file mode 100644 index 00000000..bd615bb0 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/ProcessingElementsContainer.class differ diff --git a/out/production/classes/graphql/annotations/processor/exceptions/CannotCastMemberException.class b/out/production/classes/graphql/annotations/processor/exceptions/CannotCastMemberException.class new file mode 100644 index 00000000..a5a0284e Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/exceptions/CannotCastMemberException.class differ diff --git a/out/production/classes/graphql/annotations/processor/exceptions/GraphQLAnnotationsException.class b/out/production/classes/graphql/annotations/processor/exceptions/GraphQLAnnotationsException.class new file mode 100644 index 00000000..38ea6586 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/exceptions/GraphQLAnnotationsException.class differ diff --git a/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLAnnotationsProcessor.class b/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLAnnotationsProcessor.class new file mode 100644 index 00000000..55afa25c Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLAnnotationsProcessor.class differ diff --git a/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLInputProcessor.class b/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLInputProcessor.class new file mode 100644 index 00000000..a589f28a Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLInputProcessor.class differ diff --git a/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLOutputProcessor.class b/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLOutputProcessor.class new file mode 100644 index 00000000..fb7d2f30 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/graphQLProcessors/GraphQLOutputProcessor.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/GraphQLFieldRetriever.class b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLFieldRetriever.class new file mode 100644 index 00000000..444378e3 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLFieldRetriever.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/GraphQLInputObjectRetriever.class b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLInputObjectRetriever.class new file mode 100644 index 00000000..353176ea Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLInputObjectRetriever.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/GraphQLInterfaceRetriever.class b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLInterfaceRetriever.class new file mode 100644 index 00000000..acdbb873 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLInterfaceRetriever.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/GraphQLObjectHandler.class b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLObjectHandler.class new file mode 100644 index 00000000..85a05d5b Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLObjectHandler.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/GraphQLObjectInfoRetriever.class b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLObjectInfoRetriever.class new file mode 100644 index 00000000..23da2c88 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLObjectInfoRetriever.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/GraphQLOutputObjectRetriever.class b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLOutputObjectRetriever.class new file mode 100644 index 00000000..3e0ac67a Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/GraphQLOutputObjectRetriever.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/ArgumentBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/ArgumentBuilder.class new file mode 100644 index 00000000..506d2f8d Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/ArgumentBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/Builder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/Builder.class new file mode 100644 index 00000000..f276474c Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/Builder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/DeprecateBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/DeprecateBuilder.class new file mode 100644 index 00000000..7dd51178 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/DeprecateBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/DescriptionBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/DescriptionBuilder.class new file mode 100644 index 00000000..79e3e5e9 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/DescriptionBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldDataFetcherBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldDataFetcherBuilder.class new file mode 100644 index 00000000..3d4ab5f6 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldDataFetcherBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldNameBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldNameBuilder.class new file mode 100644 index 00000000..dd6eb082 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldNameBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.class new file mode 100644 index 00000000..f21a9ef4 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodNameBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodNameBuilder.class new file mode 100644 index 00000000..d7f06dcf Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodNameBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.class b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.class new file mode 100644 index 00000000..5647121f Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodTypeBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/searchAlgorithms/BreadthFirstSearch.class b/out/production/classes/graphql/annotations/processor/searchAlgorithms/BreadthFirstSearch.class new file mode 100644 index 00000000..31ecadea Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/searchAlgorithms/BreadthFirstSearch.class differ diff --git a/out/production/classes/graphql/annotations/processor/searchAlgorithms/ParentalSearch.class b/out/production/classes/graphql/annotations/processor/searchAlgorithms/ParentalSearch.class new file mode 100644 index 00000000..7065ea54 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/searchAlgorithms/ParentalSearch.class differ diff --git a/out/production/classes/graphql/annotations/processor/searchAlgorithms/SearchAlgorithm.class b/out/production/classes/graphql/annotations/processor/searchAlgorithms/SearchAlgorithm.class new file mode 100644 index 00000000..8ad75b6e Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/searchAlgorithms/SearchAlgorithm.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeBuilders/EnumBuilder.class b/out/production/classes/graphql/annotations/processor/typeBuilders/EnumBuilder.class new file mode 100644 index 00000000..89ddcb9a Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeBuilders/EnumBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeBuilders/InterfaceBuilder.class b/out/production/classes/graphql/annotations/processor/typeBuilders/InterfaceBuilder.class new file mode 100644 index 00000000..09600a5a Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeBuilders/InterfaceBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeBuilders/ObjectBuilder.class b/out/production/classes/graphql/annotations/processor/typeBuilders/ObjectBuilder.class new file mode 100644 index 00000000..5c6529a9 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeBuilders/ObjectBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeBuilders/UnionBuilder$1.class b/out/production/classes/graphql/annotations/processor/typeBuilders/UnionBuilder$1.class new file mode 100644 index 00000000..28af033c Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeBuilders/UnionBuilder$1.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeBuilders/UnionBuilder.class b/out/production/classes/graphql/annotations/processor/typeBuilders/UnionBuilder.class new file mode 100644 index 00000000..c9b7bc16 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeBuilders/UnionBuilder.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/BatchedTypeFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/BatchedTypeFunction.class new file mode 100644 index 00000000..cd2453c8 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/BatchedTypeFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/BooleanFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/BooleanFunction.class new file mode 100644 index 00000000..869eeb26 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/BooleanFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunction.class new file mode 100644 index 00000000..6dcda711 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/FloatFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/FloatFunction.class new file mode 100644 index 00000000..d54a65ca Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/FloatFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/IDFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/IDFunction.class new file mode 100644 index 00000000..f8009352 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/IDFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/IntegerFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/IntegerFunction.class new file mode 100644 index 00000000..b63494ad Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/IntegerFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/IterableFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/IterableFunction.class new file mode 100644 index 00000000..282fd20d Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/IterableFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/LongFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/LongFunction.class new file mode 100644 index 00000000..9250b572 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/LongFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/ObjectFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/ObjectFunction.class new file mode 100644 index 00000000..97426276 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/ObjectFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/OptionalFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/OptionalFunction.class new file mode 100644 index 00000000..ecdf3ac6 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/OptionalFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/StreamFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/StreamFunction.class new file mode 100644 index 00000000..bc059c53 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/StreamFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/StringFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/StringFunction.class new file mode 100644 index 00000000..e28c6f50 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/StringFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/typeFunctions/TypeFunction.class b/out/production/classes/graphql/annotations/processor/typeFunctions/TypeFunction.class new file mode 100644 index 00000000..9d04a0ce Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/typeFunctions/TypeFunction.class differ diff --git a/out/production/classes/graphql/annotations/processor/util/Base64.class b/out/production/classes/graphql/annotations/processor/util/Base64.class new file mode 100644 index 00000000..f467a4f3 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/util/Base64.class differ diff --git a/out/production/classes/graphql/annotations/processor/util/ConnectionUtil.class b/out/production/classes/graphql/annotations/processor/util/ConnectionUtil.class new file mode 100644 index 00000000..be5ceeeb Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/util/ConnectionUtil.class differ diff --git a/out/production/classes/graphql/annotations/processor/util/DataFetcherConstructor.class b/out/production/classes/graphql/annotations/processor/util/DataFetcherConstructor.class new file mode 100644 index 00000000..e279e72e Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/util/DataFetcherConstructor.class differ diff --git a/out/production/classes/graphql/annotations/processor/util/NamingKit.class b/out/production/classes/graphql/annotations/processor/util/NamingKit.class new file mode 100644 index 00000000..68abf4bf Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/util/NamingKit.class differ diff --git a/out/production/classes/graphql/annotations/processor/util/ObjectUtil.class b/out/production/classes/graphql/annotations/processor/util/ObjectUtil.class new file mode 100644 index 00000000..ac731c89 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/util/ObjectUtil.class differ diff --git a/out/production/classes/graphql/annotations/processor/util/ReflectionKit.class b/out/production/classes/graphql/annotations/processor/util/ReflectionKit.class new file mode 100644 index 00000000..6f8c49b6 Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/util/ReflectionKit.class differ diff --git a/out/production/classes/graphql/annotations/processor/util/RelayKit.class b/out/production/classes/graphql/annotations/processor/util/RelayKit.class new file mode 100644 index 00000000..86d35e4f Binary files /dev/null and b/out/production/classes/graphql/annotations/processor/util/RelayKit.class differ diff --git a/out/production/classes/graphql/annotations/strategies/EnhancedExecutionStrategy.class b/out/production/classes/graphql/annotations/strategies/EnhancedExecutionStrategy.class new file mode 100644 index 00000000..7fe47279 Binary files /dev/null and b/out/production/classes/graphql/annotations/strategies/EnhancedExecutionStrategy.class differ diff --git a/out/production/classes/graphql/annotations/typeResolvers/UnionTypeResolver.class b/out/production/classes/graphql/annotations/typeResolvers/UnionTypeResolver.class new file mode 100644 index 00000000..40c34c03 Binary files /dev/null and b/out/production/classes/graphql/annotations/typeResolvers/UnionTypeResolver.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoListBatchedField.class b/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoListBatchedField.class new file mode 100644 index 00000000..9a5af83f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoListBatchedField.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoParameterizedBatchedField.class b/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoParameterizedBatchedField.class new file mode 100644 index 00000000..b7a14369 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoParameterizedBatchedField.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoStaticBatchedField.class b/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoStaticBatchedField.class new file mode 100644 index 00000000..a16ad09d Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLBatchedTest$NoStaticBatchedField.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLBatchedTest$SimpleBatchedField.class b/out/test/classes/graphql/annotations/GraphQLBatchedTest$SimpleBatchedField.class new file mode 100644 index 00000000..990ffd33 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLBatchedTest$SimpleBatchedField.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLBatchedTest$TestBatchedObject.class b/out/test/classes/graphql/annotations/GraphQLBatchedTest$TestBatchedObject.class new file mode 100644 index 00000000..7bd17e6e Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLBatchedTest$TestBatchedObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLBatchedTest.class b/out/test/classes/graphql/annotations/GraphQLBatchedTest.class new file mode 100644 index 00000000..057eb3ff Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLBatchedTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$Sample.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$Sample.class new file mode 100644 index 00000000..b71adee9 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$Sample.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleDataFetcher.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleDataFetcher.class new file mode 100644 index 00000000..d4c36ddc Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleDataFetcher.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleMultiArgDataFetcher.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleMultiArgDataFetcher.class new file mode 100644 index 00000000..818db79b Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleMultiArgDataFetcher.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleOneArgDataFetcher.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleOneArgDataFetcher.class new file mode 100644 index 00000000..19d242dd Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$SampleOneArgDataFetcher.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestGraphQLQuery.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestGraphQLQuery.class new file mode 100644 index 00000000..4895f572 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestGraphQLQuery.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestMethodWithDataFetcherGraphQLQuery.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestMethodWithDataFetcherGraphQLQuery.class new file mode 100644 index 00000000..ac0bbbca Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestMethodWithDataFetcherGraphQLQuery.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestSample.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestSample.class new file mode 100644 index 00000000..4e7f7cd0 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestSample.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestSampleMethod.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestSampleMethod.class new file mode 100644 index 00000000..317745d5 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest$TestSampleMethod.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLDataFetcherTest.class b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest.class new file mode 100644 index 00000000..f5ffeebc Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLDataFetcherTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLEnumTest$Foo.class b/out/test/classes/graphql/annotations/GraphQLEnumTest$Foo.class new file mode 100644 index 00000000..5da3e9f4 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLEnumTest$Foo.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLEnumTest$Query.class b/out/test/classes/graphql/annotations/GraphQLEnumTest$Query.class new file mode 100644 index 00000000..d4317bff Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLEnumTest$Query.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLEnumTest$User.class b/out/test/classes/graphql/annotations/GraphQLEnumTest$User.class new file mode 100644 index 00000000..ae8c8604 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLEnumTest$User.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLEnumTest.class b/out/test/classes/graphql/annotations/GraphQLEnumTest.class new file mode 100644 index 00000000..f720584c Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLEnumTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestDataFetcher.class b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestDataFetcher.class new file mode 100644 index 00000000..85270620 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestDataFetcher.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObject.class b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObject.class new file mode 100644 index 00000000..35b6ba66 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObjectExtension.class b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObjectExtension.class new file mode 100644 index 00000000..f7d4235f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObjectExtension.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObjectExtensionInvalid.class b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObjectExtensionInvalid.class new file mode 100644 index 00000000..25534b06 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLExtensionsTest$TestObjectExtensionInvalid.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLExtensionsTest.class b/out/test/classes/graphql/annotations/GraphQLExtensionsTest.class new file mode 100644 index 00000000..7563d978 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLExtensionsTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyInterface.class b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyInterface.class new file mode 100644 index 00000000..2b30fb88 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyInterface.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyObject.class b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyObject.class new file mode 100644 index 00000000..0bee663f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyObject2.class b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyObject2.class new file mode 100644 index 00000000..7ce19d42 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyObject2.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyTypeResolver.class b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyTypeResolver.class new file mode 100644 index 00000000..400649f5 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLFragmentTest$MyTypeResolver.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLFragmentTest$RootObject.class b/out/test/classes/graphql/annotations/GraphQLFragmentTest$RootObject.class new file mode 100644 index 00000000..aa5d4a85 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLFragmentTest$RootObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLFragmentTest.class b/out/test/classes/graphql/annotations/GraphQLFragmentTest.class new file mode 100644 index 00000000..f1388bc7 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLFragmentTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$Code.class b/out/test/classes/graphql/annotations/GraphQLInputTest$Code.class new file mode 100644 index 00000000..2cc246a7 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$Code.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$InputObject.class b/out/test/classes/graphql/annotations/GraphQLInputTest$InputObject.class new file mode 100644 index 00000000..284c0e2f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$InputObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$Query.class b/out/test/classes/graphql/annotations/GraphQLInputTest$Query.class new file mode 100644 index 00000000..7303166b Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$Query.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$QueryIface.class b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryIface.class new file mode 100644 index 00000000..754df6f8 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryIface.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$QueryList.class b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryList.class new file mode 100644 index 00000000..5e003bf2 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryList.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$QueryMultipleDefinitions.class b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryMultipleDefinitions.class new file mode 100644 index 00000000..2cda5ca1 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryMultipleDefinitions.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$QueryRecursion.class b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryRecursion.class new file mode 100644 index 00000000..8d8583fe Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$QueryRecursion.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$RecursiveInputObject.class b/out/test/classes/graphql/annotations/GraphQLInputTest$RecursiveInputObject.class new file mode 100644 index 00000000..88e86fd7 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$RecursiveInputObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$Resolver.class b/out/test/classes/graphql/annotations/GraphQLInputTest$Resolver.class new file mode 100644 index 00000000..941767bb Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$Resolver.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$SubInputObject.class b/out/test/classes/graphql/annotations/GraphQLInputTest$SubInputObject.class new file mode 100644 index 00000000..4cc44c2e Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$SubInputObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$TestIface.class b/out/test/classes/graphql/annotations/GraphQLInputTest$TestIface.class new file mode 100644 index 00000000..dfb3921d Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$TestIface.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$TestObject.class b/out/test/classes/graphql/annotations/GraphQLInputTest$TestObject.class new file mode 100644 index 00000000..d2c213d8 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$TestObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$TestObjectList.class b/out/test/classes/graphql/annotations/GraphQLInputTest$TestObjectList.class new file mode 100644 index 00000000..d6af9e03 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$TestObjectList.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest$TestObjectRec.class b/out/test/classes/graphql/annotations/GraphQLInputTest$TestObjectRec.class new file mode 100644 index 00000000..025ab81f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest$TestObjectRec.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInputTest.class b/out/test/classes/graphql/annotations/GraphQLInputTest.class new file mode 100644 index 00000000..809ad7c2 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInputTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$BaseTestIface.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$BaseTestIface.class new file mode 100644 index 00000000..a8d094e4 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$BaseTestIface.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$IfaceFetcher.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$IfaceFetcher.class new file mode 100644 index 00000000..ab3dd5dd Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$IfaceFetcher.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$NoResolverIface.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$NoResolverIface.class new file mode 100644 index 00000000..c2151e91 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$NoResolverIface.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$Query.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$Query.class new file mode 100644 index 00000000..0cc0ecde Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$Query.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$Resolver.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$Resolver.class new file mode 100644 index 00000000..513c15dd Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$Resolver.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestIface.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestIface.class new file mode 100644 index 00000000..76fb87d8 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestIface.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestObject.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestObject.class new file mode 100644 index 00000000..8cffe1db Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestObject1.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestObject1.class new file mode 100644 index 00000000..17207156 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestObject1.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestUnion.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestUnion.class new file mode 100644 index 00000000..29e97efc Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$TestUnion.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest$UnionQuery.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$UnionQuery.class new file mode 100644 index 00000000..1eb98db7 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest$UnionQuery.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLInterfaceTest.class b/out/test/classes/graphql/annotations/GraphQLInterfaceTest.class new file mode 100644 index 00000000..a1875ea0 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLInterfaceTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$Class1.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$Class1.class new file mode 100644 index 00000000..47a5b642 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$Class1.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$Class2.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$Class2.class new file mode 100644 index 00000000..1a861d8d Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$Class2.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$DefaultAValue.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$DefaultAValue.class new file mode 100644 index 00000000..cfa749c6 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$DefaultAValue.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$EnumTest$E.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$EnumTest$E.class new file mode 100644 index 00000000..9953308f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$EnumTest$E.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$EnumTest.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$EnumTest.class new file mode 100644 index 00000000..ad7d274f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$EnumTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$Iface.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$Iface.class new file mode 100644 index 00000000..9cda7815 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$Iface.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$IfaceImpl.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$IfaceImpl.class new file mode 100644 index 00000000..5a71ccee Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$IfaceImpl.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$InheritGraphQLFieldTest.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$InheritGraphQLFieldTest.class new file mode 100644 index 00000000..ebed4570 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$InheritGraphQLFieldTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$OnMethodTest.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$OnMethodTest.class new file mode 100644 index 00000000..b02c6952 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$OnMethodTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$OptionalTest.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$OptionalTest.class new file mode 100644 index 00000000..c8fefb49 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$OptionalTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$ParametrizedArgsTest.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$ParametrizedArgsTest.class new file mode 100644 index 00000000..39a75740 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$ParametrizedArgsTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$PrivateTestField.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$PrivateTestField.class new file mode 100644 index 00000000..7e4bf1a6 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$PrivateTestField.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestAccessors.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestAccessors.class new file mode 100644 index 00000000..26b12b6a Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestAccessors.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestComplexInputArgument.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestComplexInputArgument.class new file mode 100644 index 00000000..99a91143 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestComplexInputArgument.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestCustomType.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestCustomType.class new file mode 100644 index 00000000..a85b442e Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestCustomType.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestCustomTypeFunction.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestCustomTypeFunction.class new file mode 100644 index 00000000..9bfd8046 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestCustomTypeFunction.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestDataFetcher.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestDataFetcher.class new file mode 100644 index 00000000..99c4740e Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestDataFetcher.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestDefaults.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestDefaults.class new file mode 100644 index 00000000..8008ca75 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestDefaults.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestFetcher.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestFetcher.class new file mode 100644 index 00000000..d0c776f9 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestFetcher.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestField.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestField.class new file mode 100644 index 00000000..7a645842 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestField.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestInputArgument.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestInputArgument.class new file mode 100644 index 00000000..8c54aa11 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestInputArgument.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObject.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObject.class new file mode 100644 index 00000000..d713f266 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObject.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectBridgMethod.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectBridgMethod.class new file mode 100644 index 00000000..a3974892 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectBridgMethod.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectBridgMethodParent.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectBridgMethodParent.class new file mode 100644 index 00000000..495ab3dc Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectBridgMethodParent.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectInherited.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectInherited.class new file mode 100644 index 00000000..c79ae7b1 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectInherited.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectInput.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectInput.class new file mode 100644 index 00000000..e1d9bf46 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectInput.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectNamedArgs.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectNamedArgs.class new file mode 100644 index 00000000..cae740dd Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$TestObjectNamedArgs.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest$UUIDTypeFunction.class b/out/test/classes/graphql/annotations/GraphQLObjectTest$UUIDTypeFunction.class new file mode 100644 index 00000000..d26c8b8f Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest$UUIDTypeFunction.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLObjectTest.class b/out/test/classes/graphql/annotations/GraphQLObjectTest.class new file mode 100644 index 00000000..bfb4ff55 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLObjectTest.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest$Query.class b/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest$Query.class new file mode 100644 index 00000000..56a1b55d Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest$Query.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest$User.class b/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest$User.class new file mode 100644 index 00000000..6afa6dc9 Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest$User.class differ diff --git a/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest.class b/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest.class new file mode 100644 index 00000000..8416329a Binary files /dev/null and b/out/test/classes/graphql/annotations/GraphQLSimpleSchemaTest.class differ diff --git a/out/test/classes/graphql/annotations/MethodDataFetcherTest$TestException.class b/out/test/classes/graphql/annotations/MethodDataFetcherTest$TestException.class new file mode 100644 index 00000000..e028e67a Binary files /dev/null and b/out/test/classes/graphql/annotations/MethodDataFetcherTest$TestException.class differ diff --git a/out/test/classes/graphql/annotations/MethodDataFetcherTest.class b/out/test/classes/graphql/annotations/MethodDataFetcherTest.class new file mode 100644 index 00000000..73e3e955 Binary files /dev/null and b/out/test/classes/graphql/annotations/MethodDataFetcherTest.class differ diff --git a/out/test/classes/graphql/annotations/RelayTest$IResult.class b/out/test/classes/graphql/annotations/RelayTest$IResult.class new file mode 100644 index 00000000..c77e15b3 Binary files /dev/null and b/out/test/classes/graphql/annotations/RelayTest$IResult.class differ diff --git a/out/test/classes/graphql/annotations/RelayTest$Result.class b/out/test/classes/graphql/annotations/RelayTest$Result.class new file mode 100644 index 00000000..6aef4975 Binary files /dev/null and b/out/test/classes/graphql/annotations/RelayTest$Result.class differ diff --git a/out/test/classes/graphql/annotations/RelayTest$ResultTypeResolver.class b/out/test/classes/graphql/annotations/RelayTest$ResultTypeResolver.class new file mode 100644 index 00000000..e62dc1e9 Binary files /dev/null and b/out/test/classes/graphql/annotations/RelayTest$ResultTypeResolver.class differ diff --git a/out/test/classes/graphql/annotations/RelayTest$TestObject.class b/out/test/classes/graphql/annotations/RelayTest$TestObject.class new file mode 100644 index 00000000..2579fbb7 Binary files /dev/null and b/out/test/classes/graphql/annotations/RelayTest$TestObject.class differ diff --git a/out/test/classes/graphql/annotations/RelayTest$WrongReturnType.class b/out/test/classes/graphql/annotations/RelayTest$WrongReturnType.class new file mode 100644 index 00000000..e816e2d4 Binary files /dev/null and b/out/test/classes/graphql/annotations/RelayTest$WrongReturnType.class differ diff --git a/out/test/classes/graphql/annotations/RelayTest.class b/out/test/classes/graphql/annotations/RelayTest.class new file mode 100644 index 00000000..39da5607 Binary files /dev/null and b/out/test/classes/graphql/annotations/RelayTest.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$CustomConnection.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$CustomConnection.class new file mode 100644 index 00000000..de9dad81 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$CustomConnection.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$DuplicateTest.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$DuplicateTest.class new file mode 100644 index 00000000..8d36ae20 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$DuplicateTest.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$Obj.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$Obj.class new file mode 100644 index 00000000..2b36de0c Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$Obj.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnectionOnField$1.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnectionOnField$1.class new file mode 100644 index 00000000..9c4451e8 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnectionOnField$1.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnectionOnField.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnectionOnField.class new file mode 100644 index 00000000..a7b5aaeb Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnectionOnField.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$1.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$1.class new file mode 100644 index 00000000..2112d9db Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$1.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$2.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$2.class new file mode 100644 index 00000000..2784bc9f Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$2.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$3.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$3.class new file mode 100644 index 00000000..62299120 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$3.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$4.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$4.class new file mode 100644 index 00000000..c7521b8f Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections$4.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections.class new file mode 100644 index 00000000..07798901 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestConnections.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestCustomConnection$1.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestCustomConnection$1.class new file mode 100644 index 00000000..53b719ed Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestCustomConnection$1.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestCustomConnection.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestCustomConnection.class new file mode 100644 index 00000000..c9a10c82 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestCustomConnection.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField$1.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField$1.class new file mode 100644 index 00000000..1017f7d8 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField$1.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField.class new file mode 100644 index 00000000..b2f300f8 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField2$1.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField2$1.class new file mode 100644 index 00000000..d53eb7ae Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField2$1.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField2.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField2.class new file mode 100644 index 00000000..baedc603 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest$TestListField2.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest.class b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest.class new file mode 100644 index 00000000..2da70a34 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLConnectionTest.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$GoodConnectionDataFetcher$1.class b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$GoodConnectionDataFetcher$1.class new file mode 100644 index 00000000..f0e76316 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$GoodConnectionDataFetcher$1.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$GoodConnectionDataFetcher.class b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$GoodConnectionDataFetcher.class new file mode 100644 index 00000000..4306c241 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$GoodConnectionDataFetcher.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$NotGoodDataFetcher.class b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$NotGoodDataFetcher.class new file mode 100644 index 00000000..c002d6a8 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$NotGoodDataFetcher.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$NotValidConnectionField.class b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$NotValidConnectionField.class new file mode 100644 index 00000000..06b7e1cb Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$NotValidConnectionField.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$Obj.class b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$Obj.class new file mode 100644 index 00000000..99576222 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$Obj.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$TestListField.class b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$TestListField.class new file mode 100644 index 00000000..d7c51f07 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest$TestListField.class differ diff --git a/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest.class b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest.class new file mode 100644 index 00000000..adbcf7e0 Binary files /dev/null and b/out/test/classes/graphql/annotations/connection/GraphQLEnhancedConnectionTest.class differ diff --git a/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/DeprecateBuilderTest.class b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/DeprecateBuilderTest.class new file mode 100644 index 00000000..ebef60c5 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/DeprecateBuilderTest.class differ diff --git a/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/DescriptionBuilderTest.class b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/DescriptionBuilderTest.class new file mode 100644 index 00000000..23cf78b7 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/DescriptionBuilderTest.class differ diff --git a/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldNameBuilderTest.class b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldNameBuilderTest.class new file mode 100644 index 00000000..0953d579 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldNameBuilderTest.class differ diff --git a/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodNameBuilderTest.class b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodNameBuilderTest.class new file mode 100644 index 00000000..b2b041ef Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodNameBuilderTest.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/BooleanFunctionTests.class b/out/test/classes/graphql/annotations/processor/typeFunctions/BooleanFunctionTests.class new file mode 100644 index 00000000..665f7b99 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/BooleanFunctionTests.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$A.class b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$A.class new file mode 100644 index 00000000..7e131163 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$A.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$Class1.class b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$Class1.class new file mode 100644 index 00000000..cfa68542 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$Class1.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$Class2.class b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$Class2.class new file mode 100644 index 00000000..b9518f6c Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest$Class2.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest.class b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest.class new file mode 100644 index 00000000..cb28ab02 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTest.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTestHelper.class b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTestHelper.class new file mode 100644 index 00000000..bab59038 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/DefaultTypeFunctionTestHelper.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/FloatFunctionTests.class b/out/test/classes/graphql/annotations/processor/typeFunctions/FloatFunctionTests.class new file mode 100644 index 00000000..759e0de0 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/FloatFunctionTests.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/IDFunctionTests.class b/out/test/classes/graphql/annotations/processor/typeFunctions/IDFunctionTests.class new file mode 100644 index 00000000..6e76ba42 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/IDFunctionTests.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/IntegerFunctionTests.class b/out/test/classes/graphql/annotations/processor/typeFunctions/IntegerFunctionTests.class new file mode 100644 index 00000000..aba27a00 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/IntegerFunctionTests.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/LongFunctionTests.class b/out/test/classes/graphql/annotations/processor/typeFunctions/LongFunctionTests.class new file mode 100644 index 00000000..10913b91 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/LongFunctionTests.class differ diff --git a/out/test/classes/graphql/annotations/processor/typeFunctions/StringFunctionTests.class b/out/test/classes/graphql/annotations/processor/typeFunctions/StringFunctionTests.class new file mode 100644 index 00000000..37679ba0 Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/typeFunctions/StringFunctionTests.class differ diff --git a/out/test/classes/graphql/annotations/processor/util/CustomRelay.class b/out/test/classes/graphql/annotations/processor/util/CustomRelay.class new file mode 100644 index 00000000..8c1ba02f Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/util/CustomRelay.class differ diff --git a/out/test/classes/graphql/annotations/processor/util/NamingKitTest.class b/out/test/classes/graphql/annotations/processor/util/NamingKitTest.class new file mode 100644 index 00000000..ca51398d Binary files /dev/null and b/out/test/classes/graphql/annotations/processor/util/NamingKitTest.class differ diff --git a/src/main/java/graphql/annotations/connection/AbstractPaginatedData.java b/src/main/java/graphql/annotations/connection/AbstractPaginatedData.java new file mode 100644 index 00000000..a1bca98c --- /dev/null +++ b/src/main/java/graphql/annotations/connection/AbstractPaginatedData.java @@ -0,0 +1,45 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +import java.util.Iterator; + +public abstract class AbstractPaginatedData implements PaginatedData { + + boolean hasPreviousPage; + boolean hasNextPage; + Iterable data; + + public AbstractPaginatedData(boolean hasPreviousPage, boolean hasNextPage, Iterable data) { + this.hasNextPage = hasNextPage; + this.hasPreviousPage = hasPreviousPage; + this.data = data; + } + + @Override + public boolean hasNextPage() { + return hasNextPage; + } + + @Override + public boolean hasPreviousPage() { + return hasPreviousPage; + } + + @Override + public Iterator iterator() { + return data.iterator(); + } +} \ No newline at end of file diff --git a/src/main/java/graphql/annotations/connection/ConnectionDataFetcher.java b/src/main/java/graphql/annotations/connection/ConnectionDataFetcher.java new file mode 100644 index 00000000..f3e2b907 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/ConnectionDataFetcher.java @@ -0,0 +1,52 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +import graphql.relay.Connection; +import graphql.schema.DataFetcher; +import graphql.schema.DataFetchingEnvironment; + +import java.lang.reflect.Constructor; +import java.util.Arrays; +import java.util.Optional; + +import static graphql.annotations.processor.util.ReflectionKit.constructNewInstance; + + +public class ConnectionDataFetcher implements DataFetcher> { + private final DataFetcher actualDataFetcher; + private final Constructor> constructor; + + @SuppressWarnings("unchecked") + public ConnectionDataFetcher(Class> connection, DataFetcher actualDataFetcher) { + this.actualDataFetcher = actualDataFetcher; + Optional>> constructor = + Arrays.stream(connection.getConstructors()). + filter(c -> c.getParameterCount() == 1). + map(c -> (Constructor>) c). + findFirst(); + if (constructor.isPresent()) { + this.constructor = constructor.get(); + } else { + throw new IllegalArgumentException(connection.getSimpleName() + " doesn't have a single argument constructor"); + } + } + + @Override + public Connection get(DataFetchingEnvironment environment) { + ConnectionFetcher conn = constructNewInstance(constructor, actualDataFetcher); + return conn.get(environment); + } +} diff --git a/src/main/java/graphql/annotations/connection/ConnectionFetcher.java b/src/main/java/graphql/annotations/connection/ConnectionFetcher.java new file mode 100644 index 00000000..861d1944 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/ConnectionFetcher.java @@ -0,0 +1,21 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +import graphql.relay.Connection; +import graphql.schema.DataFetcher; + +public interface ConnectionFetcher extends DataFetcher> { +} diff --git a/src/main/java/graphql/annotations/connection/ConnectionValidator.java b/src/main/java/graphql/annotations/connection/ConnectionValidator.java new file mode 100644 index 00000000..c28b46e1 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/ConnectionValidator.java @@ -0,0 +1,22 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +import java.lang.reflect.AccessibleObject; + +public interface ConnectionValidator { + + void validate(AccessibleObject field); +} diff --git a/src/main/java/graphql/annotations/annotationTypes/GraphQLConnection.java b/src/main/java/graphql/annotations/connection/GraphQLConnection.java similarity index 62% rename from src/main/java/graphql/annotations/annotationTypes/GraphQLConnection.java rename to src/main/java/graphql/annotations/connection/GraphQLConnection.java index fe5c99db..9f0be8cf 100644 --- a/src/main/java/graphql/annotations/annotationTypes/GraphQLConnection.java +++ b/src/main/java/graphql/annotations/connection/GraphQLConnection.java @@ -12,10 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and */ -package graphql.annotations.annotationTypes; +package graphql.annotations.connection; -import graphql.annotations.dataFetchers.connection.Connection; -import graphql.annotations.dataFetchers.connection.DispatchingConnection; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -24,7 +22,7 @@ /** * Specifies that the annotated field or method (given it is also - * annotated with {@link GraphQLField}) is a collection that will + * annotated with {@link graphql.annotations.annotationTypes.GraphQLField}) is a collection that will * be adhering Relay Connection specification * * At the moment, the only allowed type for such field is List<?> @@ -33,11 +31,13 @@ @Retention(RetentionPolicy.RUNTIME) public @interface GraphQLConnection { /** - * By default, a simple List connection is specified, but can be overridden using - * this property to allow for more efficient fetching procedures (limiting database queries, etc.) + * By default, a paginated data connection is specified. + * this property allows for more efficient fetching procedures (limiting database queries, etc.) + * NOTE: if you override this, you should also override the validator field, and specify + * your own connection validator * @return a connection class */ - Class connection() default DispatchingConnection.class; + Class connection() default PaginatedDataConnectionFetcher.class; /** * By default, wrapped type's name is used for naming TypeConnection, but can be overridden @@ -45,4 +45,11 @@ * @return the wrapped type's name */ String name() default ""; + + /** + * By default, the the validator validates a paginated data connection. + * Can be overridden (and should be) if you are using a custom connection + * @return a connection validator + */ + Class validator() default PaginatedDataConnectionTypeValidator.class; } diff --git a/src/main/java/graphql/annotations/connection/GraphQLConnectionException.java b/src/main/java/graphql/annotations/connection/GraphQLConnectionException.java new file mode 100644 index 00000000..7f727145 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/GraphQLConnectionException.java @@ -0,0 +1,22 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +class GraphQLConnectionException extends RuntimeException { + + GraphQLConnectionException(String error) { + super(error); + } +} diff --git a/src/main/java/graphql/annotations/connection/PaginatedData.java b/src/main/java/graphql/annotations/connection/PaginatedData.java new file mode 100644 index 00000000..62f2da77 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/PaginatedData.java @@ -0,0 +1,48 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +/** + * This class is the result of a connection. Every Graphql connection field must return this interface + *

+ * NOTE: this interface extends Iterable. The data is retrieved from the "iterator" function. + * Please implement the iterator with data structure that has order + * + * @param the data of which we paginated over + */ +public interface PaginatedData extends Iterable { + + /** + * Whether or not this is the last page + * + * @return true if there is a next page, false otherwise + */ + boolean hasNextPage(); + + /** + * Whether or not this is the first page + * + * @return true if there is a previous page, false otherwise + */ + boolean hasPreviousPage(); + + /** + * get the encoded cursor of the entity + * + * @param entity the entity + * @return String representation of the cursor of the entity + */ + String getCursor(T entity); +} diff --git a/src/main/java/graphql/annotations/connection/PaginatedDataConnectionFetcher.java b/src/main/java/graphql/annotations/connection/PaginatedDataConnectionFetcher.java new file mode 100644 index 00000000..05542113 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/PaginatedDataConnectionFetcher.java @@ -0,0 +1,74 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +import graphql.relay.*; +import graphql.schema.DataFetcher; +import graphql.schema.DataFetchingEnvironment; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +/** + * Use this class in {@link GraphQLConnection} to do a real pagination, + * i.e you fetch each time the relevant data, you make the cursors and + * you decide if there are previous or next pages + *

+ * Note: If you are using the connection, the return type of the associated dataFetcher must implement {@link PaginatedData} + * + * @param the entity type that is paginated + */ +public class PaginatedDataConnectionFetcher implements ConnectionFetcher { + + private DataFetcher> paginationDataFetcher; + + public PaginatedDataConnectionFetcher(DataFetcher> paginationDataFetcher) { + this.paginationDataFetcher = paginationDataFetcher; + } + + @Override + public Connection get(DataFetchingEnvironment environment) { + PaginatedData paginatedData = paginationDataFetcher.get(environment); + if (paginatedData == null) { + return new DefaultConnection<>(Collections.emptyList(), new DefaultPageInfo(null,null,false,false)); + } + List> edges = buildEdges(paginatedData); + PageInfo pageInfo = getPageInfo(edges, paginatedData); + return new DefaultConnection<>(edges, pageInfo); + } + + private PageInfo getPageInfo(List> edges, PaginatedData paginatedData) { + ConnectionCursor firstCursor = edges.get(0).getCursor(); + ConnectionCursor lastCursor = edges.get(edges.size() - 1).getCursor(); + return new DefaultPageInfo( + firstCursor, + lastCursor, + paginatedData.hasPreviousPage(), + paginatedData.hasNextPage() + ); + } + + private List> buildEdges(PaginatedData paginatedData) { + Iterator data = paginatedData.iterator(); + List> edges = new ArrayList<>(); + for (; data.hasNext(); ) { + T entity = data.next(); + edges.add(new DefaultEdge<>(entity, new DefaultConnectionCursor(paginatedData.getCursor(entity)))); + } + return edges; + } +} diff --git a/src/main/java/graphql/annotations/connection/PaginatedDataConnectionTypeValidator.java b/src/main/java/graphql/annotations/connection/PaginatedDataConnectionTypeValidator.java new file mode 100644 index 00000000..fb5a4f52 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/PaginatedDataConnectionTypeValidator.java @@ -0,0 +1,43 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + + +import graphql.annotations.annotationTypes.GraphQLDataFetcher; + +import java.lang.reflect.AccessibleObject; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +public class PaginatedDataConnectionTypeValidator implements ConnectionValidator { + + public void validate(AccessibleObject field) { + if (field instanceof Field) { + if (field.isAnnotationPresent(GraphQLConnection.class) && !field.isAnnotationPresent(GraphQLDataFetcher.class)) { + throw new GraphQLConnectionException("Please don't use @GraphQLConnection on" + ((Field) field).getName() + + " without @GraphQLDataFetcher, because " + + "neither PropertyDataFetcher nor FieldDataFetcher know how to handle connection"); + } + + if (!PaginatedData.class.isAssignableFrom(((Field) field).getType())) { + throw new GraphQLConnectionException(((Field) field).getName() + " type must be PaginatedData"); + } + } else { + if (!PaginatedData.class.isAssignableFrom(((Method) field).getReturnType())) { + throw new GraphQLConnectionException(((Method) field).getName() + " return type must be PaginatedData"); + } + } + } +} diff --git a/src/main/java/graphql/annotations/connection/SimplePaginatedData.java b/src/main/java/graphql/annotations/connection/SimplePaginatedData.java new file mode 100644 index 00000000..2f431610 --- /dev/null +++ b/src/main/java/graphql/annotations/connection/SimplePaginatedData.java @@ -0,0 +1,60 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +import java.nio.charset.StandardCharsets; +import java.util.Iterator; + +import static java.util.Base64.getEncoder; + +public class SimplePaginatedData extends AbstractPaginatedData { + private static final String DUMMY_CURSOR_PREFIX = "simple-cursor"; + private final String prefix; + + public SimplePaginatedData(boolean hasPreviousPage, boolean hasNextPage, Iterable data) { + this(hasPreviousPage, hasNextPage, data, DUMMY_CURSOR_PREFIX); + } + + public SimplePaginatedData(boolean hasPreviousPage, boolean hasNextPage, Iterable data, String prefix) { + super(hasPreviousPage, hasNextPage, data); + this.prefix = prefix; + } + + /** + * creates the cursor by offset (i.e first entity has cursor 0, the second has 1 and so on) + * NOTE: to make it consistent, please make the data ordered + * + * @param entity the entity + * @return the cursor of the entity (i.e the offset) + */ + @Override + public String getCursor(T entity) { + Iterator iterator = data.iterator(); + long offset = 0; + for (; iterator.hasNext(); ) { + T next = iterator.next(); + if (entity.equals(next)) { + break; + } + offset++; + } + return createCursor(offset); + } + + private String createCursor(long offset) { + byte[] bytes = (prefix + Long.toString(offset)).getBytes(StandardCharsets.UTF_8); + return getEncoder().encodeToString(bytes); + } +} diff --git a/src/main/java/graphql/annotations/dataFetchers/ExtensionDataFetcherWrapper.java b/src/main/java/graphql/annotations/dataFetchers/ExtensionDataFetcherWrapper.java index 09e543bc..96bdb4be 100644 --- a/src/main/java/graphql/annotations/dataFetchers/ExtensionDataFetcherWrapper.java +++ b/src/main/java/graphql/annotations/dataFetchers/ExtensionDataFetcherWrapper.java @@ -25,6 +25,7 @@ public class ExtensionDataFetcherWrapper implements DataFetcher{ private final Class declaringClass; + private final DataFetcher dataFetcher; public ExtensionDataFetcherWrapper(Class declaringClass, DataFetcher dataFetcher) { @@ -44,4 +45,8 @@ public T get(DataFetchingEnvironment environment) { return dataFetcher.get(environment); } + public DataFetcher getUnwrappedDataFetcher() { + return dataFetcher; + } + } diff --git a/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java b/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java index 782e31a7..080aa61e 100644 --- a/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java +++ b/src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -27,10 +27,10 @@ import java.util.Map; import static graphql.annotations.processor.util.ReflectionKit.constructNewInstance; -import static graphql.annotations.processor.util.ReflectionKit.newInstance; import static graphql.annotations.processor.util.NamingKit.toGraphqlName; +import static graphql.annotations.processor.util.ReflectionKit.newInstance; -public class MethodDataFetcher implements DataFetcher { +public class MethodDataFetcher implements DataFetcher { private final Method method; private final ProcessingElementsContainer container; private final TypeFunction typeFunction; @@ -43,23 +43,23 @@ public MethodDataFetcher(Method method, TypeFunction typeFunction, ProcessingEle } @Override - public Object get(DataFetchingEnvironment environment) { + public T get(DataFetchingEnvironment environment) { try { - Object obj; + T obj; if (Modifier.isStatic(method.getModifiers())) { obj = null; } else if (method.getAnnotation(GraphQLInvokeDetached.class) != null) { - obj = newInstance(method.getDeclaringClass()); + obj = newInstance((Class) method.getDeclaringClass()); } else if (!method.getDeclaringClass().isInstance(environment.getSource())) { - obj = newInstance(method.getDeclaringClass(), environment.getSource()); + obj = newInstance((Class) method.getDeclaringClass(), environment.getSource()); } else { obj = environment.getSource(); if (obj == null) { return null; } } - return method.invoke(obj, invocationArgs(environment, container)); + return (T)method.invoke(obj, invocationArgs(environment, container)); } catch (IllegalAccessException | InvocationTargetException e) { throw new RuntimeException(e); } diff --git a/src/main/java/graphql/annotations/dataFetchers/connection/ConnectionDataFetcher.java b/src/main/java/graphql/annotations/dataFetchers/connection/ConnectionDataFetcher.java index ff9c1b17..8406274e 100644 --- a/src/main/java/graphql/annotations/dataFetchers/connection/ConnectionDataFetcher.java +++ b/src/main/java/graphql/annotations/dataFetchers/connection/ConnectionDataFetcher.java @@ -14,50 +14,38 @@ */ package graphql.annotations.dataFetchers.connection; +import graphql.annotations.connection.ConnectionFetcher; import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; -import graphql.schema.DataFetchingEnvironmentImpl; import java.lang.reflect.Constructor; import java.util.Arrays; -import java.util.HashMap; import java.util.Optional; import static graphql.annotations.processor.util.ReflectionKit.constructNewInstance; - public class ConnectionDataFetcher implements DataFetcher { - private final Class connection; - private final DataFetcher actualDataFetcher; - private final Constructor constructor; +public class ConnectionDataFetcher implements DataFetcher> { + private final DataFetcher actualDataFetcher; + private final Constructor> constructor; - public ConnectionDataFetcher(Class connection, DataFetcher actualDataFetcher) { - this.connection = connection; - Optional> constructor = - Arrays.asList(connection.getConstructors()).stream(). + @SuppressWarnings("unchecked") + public ConnectionDataFetcher(Class> connection, DataFetcher actualDataFetcher) { + this.actualDataFetcher = actualDataFetcher; + Optional>> constructor = + Arrays.stream(connection.getConstructors()). filter(c -> c.getParameterCount() == 1). - map(c -> (Constructor) c). + map(c -> (Constructor>) c). findFirst(); if (constructor.isPresent()) { this.constructor = constructor.get(); } else { - throw new IllegalArgumentException(connection + " doesn't have a single argument constructor"); + throw new IllegalArgumentException(connection.getSimpleName() + " doesn't have a single argument constructor"); } - this.actualDataFetcher = actualDataFetcher; } @Override - public Object get(DataFetchingEnvironment environment) { - // Create a list of arguments with connection specific arguments excluded - HashMap arguments = new HashMap<>(environment.getArguments()); - arguments.keySet().removeAll(Arrays.asList("first", "last", "before", "after")); - DataFetchingEnvironment env = new DataFetchingEnvironmentImpl(environment.getSource(), arguments, environment.getContext(), - environment.getRoot(), environment.getFieldDefinition(), environment.getFields(), environment.getFieldType(), environment.getParentType(), environment.getGraphQLSchema(), - environment.getFragmentsByName(), environment.getExecutionId(), environment.getSelectionSet(), environment.getFieldTypeInfo()); - Object data = actualDataFetcher.get(env); - if (data != null) { - Connection conn = constructNewInstance(constructor, data); - return conn.get(environment); - } - return null; + public graphql.relay.Connection get(DataFetchingEnvironment environment) { + ConnectionFetcher conn = constructNewInstance(constructor, actualDataFetcher); + return conn.get(environment); } } diff --git a/src/main/java/graphql/annotations/processor/retrievers/GraphQLFieldRetriever.java b/src/main/java/graphql/annotations/processor/retrievers/GraphQLFieldRetriever.java index 4728b6ee..88451288 100644 --- a/src/main/java/graphql/annotations/processor/retrievers/GraphQLFieldRetriever.java +++ b/src/main/java/graphql/annotations/processor/retrievers/GraphQLFieldRetriever.java @@ -16,9 +16,9 @@ import graphql.annotations.GraphQLFieldDefinitionWrapper; -import graphql.annotations.annotationTypes.GraphQLConnection; import graphql.annotations.annotationTypes.GraphQLRelayMutation; import graphql.annotations.annotationTypes.GraphQLType; +import graphql.annotations.connection.GraphQLConnection; import graphql.annotations.processor.ProcessingElementsContainer; import graphql.annotations.processor.exceptions.CannotCastMemberException; import graphql.annotations.processor.exceptions.GraphQLAnnotationsException; diff --git a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldDataFetcherBuilder.java b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldDataFetcherBuilder.java index e693d262..72fd43d3 100644 --- a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldDataFetcherBuilder.java +++ b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/field/FieldDataFetcherBuilder.java @@ -14,8 +14,8 @@ */ package graphql.annotations.processor.retrievers.fieldBuilders.field; -import graphql.annotations.annotationTypes.GraphQLConnection; import graphql.annotations.annotationTypes.GraphQLDataFetcher; +import graphql.annotations.connection.GraphQLConnection; import graphql.annotations.dataFetchers.ExtensionDataFetcherWrapper; import graphql.annotations.dataFetchers.MethodDataFetcher; import graphql.annotations.dataFetchers.connection.ConnectionDataFetcher; diff --git a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java index 58cd108b..79f9f348 100644 --- a/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java +++ b/src/main/java/graphql/annotations/processor/retrievers/fieldBuilders/method/MethodDataFetcherBuilder.java @@ -15,9 +15,9 @@ package graphql.annotations.processor.retrievers.fieldBuilders.method; import graphql.annotations.annotationTypes.GraphQLBatched; -import graphql.annotations.annotationTypes.GraphQLConnection; import graphql.annotations.annotationTypes.GraphQLDataFetcher; import graphql.annotations.annotationTypes.GraphQLRelayMutation; +import graphql.annotations.connection.GraphQLConnection; import graphql.annotations.dataFetchers.BatchedMethodDataFetcher; import graphql.annotations.dataFetchers.MethodDataFetcher; import graphql.annotations.dataFetchers.RelayMutationMethodDataFetcher; diff --git a/src/main/java/graphql/annotations/processor/util/ConnectionUtil.java b/src/main/java/graphql/annotations/processor/util/ConnectionUtil.java index b30d0891..078098a5 100644 --- a/src/main/java/graphql/annotations/processor/util/ConnectionUtil.java +++ b/src/main/java/graphql/annotations/processor/util/ConnectionUtil.java @@ -14,13 +14,16 @@ */ package graphql.annotations.processor.util; -import graphql.annotations.annotationTypes.GraphQLConnection; +import graphql.annotations.connection.ConnectionValidator; +import graphql.annotations.connection.GraphQLConnection; import graphql.schema.*; import java.lang.reflect.AccessibleObject; import java.util.Arrays; import java.util.List; +import static graphql.annotations.processor.util.ReflectionKit.newInstance; + public class ConnectionUtil { private static final List TYPES_FOR_CONNECTION = Arrays.asList(GraphQLObjectType.class, GraphQLInterfaceType.class, GraphQLUnionType.class, GraphQLTypeReference.class); @@ -29,8 +32,17 @@ public static boolean isConnection(AccessibleObject obj, GraphQLOutputType type) type = (GraphQLOutputType) ((GraphQLNonNull) type).getWrappedType(); } final GraphQLOutputType actualType = type; - return obj.isAnnotationPresent(GraphQLConnection.class) && - actualType instanceof GraphQLList && TYPES_FOR_CONNECTION.stream().anyMatch(aClass -> aClass.isInstance(((GraphQLList) actualType).getWrappedType())); + boolean isValidGraphQLTypeForConnection = obj.isAnnotationPresent(GraphQLConnection.class) && + actualType instanceof GraphQLList && TYPES_FOR_CONNECTION.stream().anyMatch(aClass -> + aClass.isInstance(((GraphQLList) actualType).getWrappedType())); + + if (isValidGraphQLTypeForConnection) { + ConnectionValidator validator = newInstance(obj.getAnnotation(GraphQLConnection.class).validator()); + validator.validate(obj); + return true; + } else { + return false; + } } } diff --git a/src/main/java/graphql/annotations/processor/util/ReflectionKit.java b/src/main/java/graphql/annotations/processor/util/ReflectionKit.java index 3b71fa15..b62a692f 100644 --- a/src/main/java/graphql/annotations/processor/util/ReflectionKit.java +++ b/src/main/java/graphql/annotations/processor/util/ReflectionKit.java @@ -32,7 +32,7 @@ public static T newInstance(Class clazz) throws GraphQLAnnotationsExcepti } } - public static T constructNewInstance(Constructor constructor, Object... args) throws GraphQLAnnotationsException { + public static T constructNewInstance(Constructor constructor, Object... args) throws GraphQLAnnotationsException { try { return constructor.newInstance(args); diff --git a/src/test/java/graphql/annotations/GraphQLConnectionTest.java b/src/test/java/graphql/annotations/connection/GraphQLConnectionTest.java similarity index 69% rename from src/test/java/graphql/annotations/GraphQLConnectionTest.java rename to src/test/java/graphql/annotations/connection/GraphQLConnectionTest.java index acc739d0..f3c4560c 100644 --- a/src/test/java/graphql/annotations/GraphQLConnectionTest.java +++ b/src/test/java/graphql/annotations/connection/GraphQLConnectionTest.java @@ -5,22 +5,20 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and */ -package graphql.annotations; +package graphql.annotations.connection; import graphql.ExecutionResult; import graphql.GraphQL; -import graphql.annotations.annotationTypes.GraphQLConnection; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; -import graphql.annotations.dataFetchers.connection.Connection; import graphql.annotations.processor.GraphQLAnnotations; import graphql.annotations.processor.exceptions.GraphQLAnnotationsException; import graphql.annotations.processor.util.CustomRelay; @@ -32,9 +30,8 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; import java.util.stream.Stream; import static graphql.annotations.processor.util.RelayKit.EMPTY_CONNECTION; @@ -72,36 +69,67 @@ public static class DuplicateTest { } public static class TestListField { - @GraphQLField - @GraphQLConnection public List objs; public TestListField(List objs) { this.objs = objs; } - } - public static class TestListField2 { @GraphQLField @GraphQLConnection + public PaginatedData objs() { + return new AbstractPaginatedData(false, true, objs) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; + } + } + + public static class TestListField2 { + public List objs; public TestListField2(List objs) { this.objs = objs; } + + @GraphQLField + @GraphQLConnection + public PaginatedData objs() { + return new AbstractPaginatedData(false, true, objs) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; + } } - @Test + public static class TestConnectionOnField { + @GraphQLField + @GraphQLConnection + public PaginatedData objs; + + public TestConnectionOnField(List objs) { + this.objs = new AbstractPaginatedData(false, true, objs) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; + } + } + + @Test(expectedExceptions = GraphQLConnectionException.class) public void fieldList() { - GraphQLObjectType object = GraphQLAnnotations.object(TestListField.class); + GraphQLObjectType object = GraphQLAnnotations.object(TestConnectionOnField.class); GraphQLSchema schema = newSchema().query(object).build(); GraphQL graphQL = GraphQL.newGraphQL(schema).build(); ExecutionResult result = graphQL.execute("{ objs(first: 1) { edges { cursor node { id, val } } } }", new TestListField(Arrays.asList(new Obj("1", "test"), new Obj("2", "hello"), new Obj("3", "world")))); - assertTrue(result.getErrors().isEmpty()); - - testResult("objs", result); } public static class TestConnections { @@ -113,33 +141,80 @@ public TestConnections(List objs) { @GraphQLField @GraphQLConnection - public List getObjs() { - return this.objs; + public PaginatedData getObjs(DataFetchingEnvironment environment) { + Integer first = environment.getArgument("first"); + List actualobjs = new ArrayList<>(objs); + + if (first != null && first < objs.size()) { + actualobjs = actualobjs.subList(0, first); + } + return new AbstractPaginatedData(false, true, actualobjs) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; } @GraphQLField @GraphQLConnection(name = "objStream") - public Stream getObjStream() { - Obj[] a = new Obj[objs.size()]; - return Stream.of(objs.toArray(a)); + public PaginatedData getObjStream(DataFetchingEnvironment environment) { + Integer first = environment.getArgument("first"); + List actualobjs = new ArrayList<>(objs); + + if (first != null && first < objs.size()) { + actualobjs = actualobjs.subList(0, first); + } + + Obj[] a = new Obj[actualobjs.size()]; + Iterable data = Stream.of(actualobjs.toArray(a))::iterator; + return new AbstractPaginatedData(false, true, data) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; } @GraphQLField @GraphQLConnection(name = "objStreamWithParam") - public Stream getObjStreamWithParam(@GraphQLName("filter") String filter) { - return this.objs.stream().filter( obj -> obj.val.startsWith(filter)); + public PaginatedData getObjStreamWithParam(DataFetchingEnvironment environment, @GraphQLName("filter") String filter) { + Integer first = environment.getArgument("first"); + List actualobjs = new ArrayList<>(objs); + List filteredObjs = actualobjs.stream().filter(obj -> obj.val.startsWith(filter)).collect(Collectors.toList()); + if (first != null && first < filteredObjs.size()) { + filteredObjs = filteredObjs.subList(0, first); + } + Iterable objIterable = filteredObjs::iterator; + return new AbstractPaginatedData(false, true, objIterable) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; } @GraphQLField @GraphQLConnection(name = "nonNullObjs") @GraphQLNonNull - public List getNonNullObjs() { - return this.objs; + public PaginatedData getNonNullObjs(DataFetchingEnvironment environment) { + Integer first = environment.getArgument("first"); + List actualobjs = new ArrayList<>(objs); + + if (first != null && first < objs.size()) { + actualobjs = actualobjs.subList(0, first); + } + return new AbstractPaginatedData(false, true, actualobjs) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; } @GraphQLField @GraphQLConnection(name = "nullObj") - public List getNullObj() { + public PaginatedData getNullObj() { return null; } @@ -171,7 +246,7 @@ public void customRelayMethodList() { graphql.schema.GraphQLObjectType f = (GraphQLObjectType) schema.getType("ObjConnection"); assertTrue(f.getFieldDefinitions().size() == 4); assertTrue(f.getFieldDefinition("nodes").getType() instanceof GraphQLList); - assertEquals(((GraphQLList)f.getFieldDefinition("nodes").getType()).getWrappedType().getName(), "Obj"); + assertEquals(((GraphQLList) f.getFieldDefinition("nodes").getType()).getWrappedType().getName(), "Obj"); GraphQLObjectType pageInfo = (GraphQLObjectType) schema.getType("PageInfo"); assertTrue(pageInfo.getFieldDefinition("additionalInfo") != null); @@ -230,7 +305,7 @@ public void methodNull() { Map>>>> data = result.getData(); - assertEquals(data.get("nullObj"), null); + assertEquals(data.get("nullObj").get("edges").size(), 0); } @Test @@ -255,7 +330,7 @@ public void methodListWithParam() { } - public static class CustomConnection implements Connection { + public static class CustomConnection implements ConnectionFetcher { public CustomConnection(Object o) { } @@ -275,8 +350,13 @@ public TestCustomConnection(List objs) { @GraphQLField @GraphQLConnection(connection = CustomConnection.class) - public List getObjs() { - return this.objs; + public PaginatedData getObjs() { + return new AbstractPaginatedData(true, false, objs) { + @Override + public String getCursor(Obj entity) { + return entity.id; + } + }; } } @@ -302,7 +382,7 @@ public void duplicateConnection() { GraphQLObjectType object = GraphQLAnnotations.object(DuplicateTest.class); GraphQLSchema schema = newSchema().query(object).build(); } catch (GraphQLAnnotationsException e) { - fail("Schema cannot be created",e); + fail("Schema cannot be created", e); } } diff --git a/src/test/java/graphql/annotations/connection/GraphQLEnhancedConnectionTest.java b/src/test/java/graphql/annotations/connection/GraphQLEnhancedConnectionTest.java new file mode 100644 index 00000000..ff8333ac --- /dev/null +++ b/src/test/java/graphql/annotations/connection/GraphQLEnhancedConnectionTest.java @@ -0,0 +1,196 @@ +/** + * Copyright 2016 Yurii Rashkovskii + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + */ +package graphql.annotations.connection; + +import graphql.ExecutionInput; +import graphql.ExecutionResult; +import graphql.GraphQL; +import graphql.annotations.annotationTypes.GraphQLDataFetcher; +import graphql.annotations.annotationTypes.GraphQLField; +import graphql.annotations.processor.GraphQLAnnotations; +import graphql.schema.DataFetcher; +import graphql.schema.DataFetchingEnvironment; +import graphql.schema.GraphQLObjectType; +import graphql.schema.GraphQLSchema; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import java.util.*; + +import static graphql.schema.GraphQLSchema.newSchema; +import static org.testng.Assert.assertEquals; + +@SuppressWarnings("ALL") +public class GraphQLEnhancedConnectionTest { + + private static GraphQL graphQL; + + + @BeforeClass + public static void setUp() throws Exception { + GraphQLAnnotations.getInstance().getTypeRegistry().clear(); + GraphQLObjectType object = GraphQLAnnotations.object(TestListField.class); + GraphQLSchema schema = newSchema().query(object).build(); + + graphQL = GraphQL.newGraphQL(schema).build(); + } + + @BeforeMethod + public void init() { + GraphQLAnnotations.getInstance().getTypeRegistry().clear(); + } + + public static class Obj { + + @GraphQLField + public String id; + + @GraphQLField + public String val; + + public Obj(String id, String val) { + this.id = id; + this.val = val; + } + + public String getId() { + return id; + } + + public String getVal() { + return val; + } + } + + public static class TestListField { + @GraphQLField + @GraphQLConnection(connection = PaginatedDataConnectionFetcher.class) + @GraphQLDataFetcher(GoodConnectionDataFetcher.class) + public PaginatedData objs; + + public TestListField(PaginatedData objs) { + this.objs = objs; + } + } + + public static class GoodConnectionDataFetcher implements DataFetcher> { + + @Override + public PaginatedData get(DataFetchingEnvironment environment) { + + Integer first = environment.getArgument("first"); + List objs = Arrays.asList(new Obj("1", "1"), new Obj("2", "2"), new Obj("3", "3")); + if (first != null && first <= 3) { + objs = objs.subList(0, first); + } + return new AbstractPaginatedData(false, true, objs) { + @Override + public String getCursor(Obj entity) { + return entity.getId(); + } + }; + } + + } + +public static class NotValidConnectionField { + @GraphQLField + @GraphQLConnection + @GraphQLDataFetcher(NotGoodDataFetcher.class) + public List objs; + + public NotValidConnectionField(List objs) { + this.objs = objs; + } +} + +public static class NotGoodDataFetcher implements DataFetcher> { + + @Override + public List get(DataFetchingEnvironment environment) { + return Collections.emptyList(); + } + +} + + + @Test(expectedExceptions = GraphQLConnectionException.class) + public void ConnectionFieldDoesntReturnPaginatedData_tryToBuildSchema_getException() throws Exception { + //Act + Assert + GraphQLAnnotations.object(NotValidConnectionField.class); + } + + @Test + public void validDatafetcher_queryForCursors_getValidCursors() throws Exception { + //Arrange + ExecutionInput executionInput = new ExecutionInput("{ objs(first:2) { edges { cursor } } }", + null, "CONTEXT", null, null); + //Act + ExecutionResult result = graphQL.execute(executionInput); + Map>>>> data = result.getData(); + List>> edges = data.get("objs").get("edges"); + + //Assert + assertEquals(edges.get(0).get("cursor"), "1"); + assertEquals(edges.get(1).get("cursor"), "2"); + } + + @Test + public void validDatafetcher_queryForValues_returnsValidValues() throws Exception { + //Arrange + ExecutionInput executionInput = new ExecutionInput("{ objs(first:2) { edges { cursor node { id, val } } } }", + null, "CONTEXT", null, null); + + //Act + ExecutionResult result = graphQL.execute(executionInput); + Map>>>> data = result.getData(); + List>> edges = data.get("objs").get("edges"); + + //Assert + assertEquals(edges.get(0).get("node").get("val"), "1"); + assertEquals(edges.get(1).get("node").get("val"), "2"); + } + + @Test + public void validDatafetcher_queryForHasPreviousPage_returnsFalse() throws Exception { + + //Arrange + ExecutionInput executionInput = new ExecutionInput("{ objs(first:2) { pageInfo { hasPreviousPage } } }", + null, "CONTEXT", null, null); + + //Act + ExecutionResult result = graphQL.execute(executionInput); + Map>>> data = result.getData(); + + //Assert + assertEquals(data.get("objs").get("pageInfo").get("hasPreviousPage"), false); + } + + @Test + public void validDatafetcher_queryForHasNextPage_returnsTrue() throws Exception { + + //Arrange + ExecutionInput executionInput = new ExecutionInput("{ objs(first:2) { pageInfo { hasNextPage } } }", + null, "CONTEXT", null, null); + + //Act + ExecutionResult result = graphQL.execute(executionInput); + Map>>> data = result.getData(); + + //Assert + assertEquals(data.get("objs").get("pageInfo").get("hasNextPage"), true); + } +}