Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graphql-java/graphql-java-type-generator
This library will autogenerate GraphQL types for usage in com.graphql-java:graphql-java
https://github.com/graphql-java/graphql-java-type-generator
Last synced: about 1 month ago
JSON representation
This library will autogenerate GraphQL types for usage in com.graphql-java:graphql-java
- Host: GitHub
- URL: https://github.com/graphql-java/graphql-java-type-generator
- Owner: graphql-java
- License: mit
- Archived: true
- Created: 2016-02-20T05:03:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-09T01:46:28.000Z (over 6 years ago)
- Last Synced: 2024-10-29T22:37:47.151Z (about 1 month ago)
- Language: Java
- Homepage:
- Size: 223 KB
- Stars: 36
- Watchers: 11
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-graphql - gaphql-java-type-generator - Auto-generates types for use with GraphQL Java (Libraries / Java Libraries)
- awesome-graphql - gaphql-java-type-generator - Auto-generates types for use with GraphQL Java (Libraries / Java Libraries)
README
# graphql-java-type-generator
# THIS PROJECT IS NOT LONGER MAINTAINED AND IN READ ONLY MODE
## About
This library will autogenerate GraphQL types for usage in com.graphql-java:graphql-javaThe generation of types can be controlled using different strategies.
A default strategy implementation is provided, one which reads java .classes through reflection.
The default strategy is augmentable to customize any aspect at all.
In fact, there is a customizable strategy for everything from the name of a type, to which DataFetcher a field uses, down to which input arguments are available.
## Usage
Since everything about type generation is configurable, types are generated based upon a BuildContext that specifies the various strategies, parameters, and type repositories.A DefaultBuildContext is provided, or another one can be made.
The best entry point to this library is BuildContext's .getOutputType(obj), .getInputType(obj), or .getInterfaceType(obj).
Direct access is given if, for example, only fields are needed.
# FAQ
* Recursive object creation? Yes.
* Java Generics? Yes, as long as type erasure has not happened.
* Enums? Yup
* Unions? Not yet... java doesn't really have those natively.
* Lists? Yes, and lists of lists
* Scalars? We additionally handle BigInteger and BigDecimal, byte, short, and charLet us know what else you need.