Skip to content

feifeiq/graphql-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-java

Note: This library is currently under development and not yet stable. GraphQL itself is just a working draft currently. So there will be changes!

It's an early version, but nearly everything should be working, except validation.

This is a GraphQL Java implementation based on the specification and the JavaScript reference implementation.

The execution part is WIP, and validation, error handling and more is still missing.

How to use it

Schema definition

A complex schema (stolen from the js reference implementation): StarWarsSchema

Query

For how to define a simple schema and execute queries: GraphQL Test

More complex use cases: StarWars query tests

How to build it

Just clone the repo and type

./gradlew build

In build/libs you will find the jar file.

Run the tests

./gradlew test

Details

graphql-java is based on the same idea as the reference implementation: It assumes nothing about the persistence technology. Instead hooks/callbacks are provided to fetch the data.

The implementation is in Java 7, but the tests are in Groovy and Spock.

The query parsing is done with ANTLR. The grammar is here.

Feedback

I would appreciate any feedback via Twitter @andimarek or Pull request/Issue.

About

GraphQL Java implementation

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 62.2%
  • Groovy 37.5%
  • Other 0.3%