GRAPHQL Java Tools is a software package that can build a corresponding Java Pojo type object from the GRAPHQL schema definition *.graphqls file.
The latest version of GRAPHQL Java Tools is the 2017.11 release of 4.3.0.
1. The project name GRAPHQL Java Tools is Graphql-java-servlet and relies on the following software modules: com.graphql-java:graphql-java:6.0 com.fasterxml.jackson.core:jackson-*:2.8.8 2. Working model of GRAPHQL Java tools
*.graphqls file <-> Pojo type Object <-> resolvers object <-> Data Repository Object
3. GRAPHQL Java Tools provides a variety of resolvers interfaces for populating Pojo type objects with data 1) three root resolvers (both inherited from Graphqlresolver)
Graphqlqueryresolver Graphqlmutationresolver Graphqlsubscriptionresolver
2 In addition, any Pojo type object referencing other Pojo types inherits the definition of the Resolvers class from Graphqlresolver.
All Resolvers objects, when Schemaparser generates Graphqlschema, are supplied to the. resolvers (...) in the form of a parameter. Method.
4. GRAPHQL Java Tools is able to automatically correlate to resolvers methods for fields in Pojo objects, and development work as follows:
1 A new fields is given in the *.graphqls file (that is, the fields is present in the Pojo type Object), as detailed in the GRAPHQL specification.
2 in the Resolvers class to give the corresponding fields access method, the method named as follows (optional): <fieldname> (Datarepositoryclassinstance, *fieldargs [, Datafetchingenvironment]) is<fieldname> (datarepositoryclassinstance, *fieldargs [, DataFetchingEnvironment]) Get<fieldname> (Datarepositoryclassinstance, *fieldargs [, datafetchingenvironment]) getField<Fieldname > (Datarepositoryclassinstance, *fieldargs [, Datafetchingenvironment])
Of these, datafetchingenvironment are optional.
3 in the Datarepository class to give the corresponding data access method, the method named as follows (optional): <fieldname> (*fieldargs [, datafetchingenvironment]) is< Fieldname> (*fieldargs [, Datafetchingenvironment]) get<fieldname> (*fieldargs [, DataFetchingEnvironment]) Getfield<fieldname> (*fieldargs [, Datafetchingenvironment])
Of these, datafetchingenvironment are optional.
5. Refer to GRAPHQL Java Tools in the MAVEN project, referenced in Pom.xml as follows:
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId> graphql-java-tools</artifactid>
<version>4.3.0</version>
</dependency>
Reference Links:
Https://github.com/graphql-java/graphql-java-tools