4
4
5
5
# GraphQL Servlet
6
6
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.
8
13
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.
10
17
11
- You can download releases from jcenter and maven central:
18
+ ## Quick start
12
19
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
14
28
repositories {
15
- jcenter()
16
29
mavenCentral()
17
30
}
31
+ ```
18
32
33
+ Add the ` graphql-java-servlet ` dependency:
34
+ ``` gradle
19
35
dependencies {
20
36
compile 'com.graphql-java-kickstart:graphql-java-servlet:6.2.0'
21
37
}
22
38
```
23
39
40
+ ### Build with Maven
41
+
42
+ Add the ` graphql-java-servlet ` dependency:
24
43
``` xml
25
44
<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 >
29
48
</dependency >
30
49
```
31
50
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:
32
75
``` xml
33
76
<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 >
38
86
</repositories >
39
87
```
40
- For Gradle:
41
- ``` groovy
42
- repositories {
43
- jcenter()
44
- }
45
- ```
46
88
47
89
# Usage
48
90
@@ -62,10 +104,6 @@ The servlet supports the following request formats:
62
104
* variables (optional)
63
105
* POST multipart parts named "query", "operationName" (optional), and "variables" (optional)
64
106
65
- ## Standalone servlet
66
-
67
- See the updated [ Getting started guide] ( https://www.graphql-java-kickstart.com/docs/graphql-java-servlet/getting-started/ ) .
68
-
69
107
## Servlet Listeners
70
108
71
109
You 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