44
55# GraphQL Servlet
66
7- This module implements a GraphQL Java Servlet. It also supports Relay.js, Apollo and OSGi out of the box.
7+ Implementation of GraphQL Java Servlet including support for Relay.js, Apollo and OSGi out of the box.
8+ This project wraps the Java implementation of GraphQL provided by [ GraphQL Java] ( https://www.graphql-java.com ) .
9+ The documentation on this site focuses around the usage of the servlet. Although some parts may dive deeper
10+ into the aspects of GraphQL Java as well, make sure to look at the
11+ [ GraphQL Java documentation] ( https://www.graphql-java.com/documentation/latest/ ) for more in depth details
12+ regarding GraphQL Java itself.
813
9- # Downloading
14+ We try to stay up to date with GraphQL Java as much as possible. The current version supports ** GraphQL Java 10.0** .
15+
16+ This project requires at least Java 8.
1017
11- You can download releases from jcenter and maven central:
18+ ## Quick start
1219
13- ``` groovy
20+ See [ Getting started] ( https://www.graphql-java-kickstart.com/docs/graphql-java-servlet/getting-started/ ) for more detailed instructions.
21+
22+ To add ` graphql-java-servlet ` to your project and get started quickly, do the following.
23+
24+ ### Build with Gradle
25+
26+ Make sure ` mavenCentral ` is amongst your repositories:
27+ ``` gradle
1428repositories {
15- jcenter()
1629 mavenCentral()
1730}
31+ ```
1832
33+ Add the ` graphql-java-servlet ` dependency:
34+ ``` gradle
1935dependencies {
2036 compile 'com.graphql-java-kickstart:graphql-java-servlet:6.2.0'
2137}
2238```
2339
40+ ### Build with Maven
41+
42+ Add the ` graphql-java-servlet ` dependency:
2443``` xml
2544<dependency >
26- <groupId >com.graphql-java-kickstart</groupId >
27- <artifactId >graphql-java-servlet</artifactId >
28- <version >6.2.0</version >
45+ <groupId >com.graphql-java-kickstart</groupId >
46+ <artifactId >graphql-java-servlet</artifactId >
47+ <version >6.2.0</version >
2948</dependency >
3049```
3150
51+ ### Create a Servlet class
52+
53+ Creating the Servlet class requires various parameters to be provided at the moment. We're working on simplifying
54+ this, to make it easier to get started. For now, take a look at [ Create a Servlet class] ({{< ref "getting-started/#create-a-servlet-class" >}})
55+ to see what's needed to create a Servlet with a schema.
56+
57+ ## Using the latest development build
58+
59+ Snapshot versions of the current ` master ` branch are availble on JFrog. Check the next snapshot version on
60+ [ Github] ( https://github.com/graphql-java-kickstart/graphql-java-servlet/blob/master/gradle.properties )
61+
62+ ### Build with Gradle
63+
64+ Add the Snapshot repository:
65+ ``` gradle
66+ repositories {
67+ mavenCentral()
68+ maven { url "http://oss.jfrog.org/artifactory/oss-snapshot-local" }
69+ }
70+ ```
71+
72+ ### Build with Maven
73+
74+ Add the Snapshot repository:
3275``` xml
3376<repositories >
34- <repository >
35- <id >jcenter</id >
36- <url >https://jcenter.bintray.com/</url >
37- </repository >
77+ <repository >
78+ <id >oss-snapshot-local</id >
79+ <name >jfrog</name >
80+ <url >http://oss.jfrog.org/artifactory/oss-snapshot-local</url >
81+ <snapshots >
82+ <enabled >true</enabled >
83+ <updatePolicy >always</updatePolicy >
84+ </snapshots >
85+ </repository >
3886</repositories >
3987```
40- For Gradle:
41- ``` groovy
42- repositories {
43- jcenter()
44- }
45- ```
4688
4789# Usage
4890
@@ -62,10 +104,6 @@ The servlet supports the following request formats:
62104 * variables (optional)
63105* POST multipart parts named "query", "operationName" (optional), and "variables" (optional)
64106
65- ## Standalone servlet
66-
67- See the updated [ Getting started guide] ( https://www.graphql-java-kickstart.com/docs/graphql-java-servlet/getting-started/ ) .
68-
69107## Servlet Listeners
70108
71109You can also add [ servlet listeners] ( https://github.com/graphql-java/graphql-java-servlet/blob/master/src/main/java/graphql/servlet/GraphQLServletListener.java ) to an existing servlet.
0 commit comments