Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 7c0fdf4

Browse files
author
Bruno Rodrigues
committed
Merge remote-tracking branch 'upstream/master' into metrics-instrumentation
2 parents 77fd7bb + 0f63510 commit 7c0fdf4

File tree

44 files changed

+743
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+743
-226
lines changed

README.md

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,32 @@
1919

2020
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2121

22+
## WARNING: NoClassDefFoundError when using GraphQL Java Tools 5.4.x
2223

23-
# Intro
24+
If you're using `graphl-java-tools` you need to set the `kotlin.version` in your Spring Boot project explicitly to
25+
version 1.3.10, because Spring Boot Starter parent currently overrides it with a 1.2.* version of Kotlin.
26+
`graphql-java-tools` requires 1.3.* however because of its coroutine support. If you don't override this version
27+
you will run into a `NoClassDefFoundError`.
28+
29+
Spring Boot team has indicated the Kotlin version will be upgraded to 1.3 in Spring Boot 2.2.
30+
31+
### Using Gradle
32+
Set the Kotlin version in your `gradle.properties`
33+
```
34+
kotlin.version=1.3.10
35+
```
36+
37+
### Using Maven
38+
Set the Kotlin version in your `<properties>` section
39+
```xml
40+
<properties>
41+
<kotlin.version>1.3.10</kotlin.version>
42+
</properties>
43+
```
44+
45+
# Documentation
46+
47+
See our new [Documentation](https://www.graphql-java-kickstart.com/spring-boot/).
2448

2549
Repository contains:
2650

@@ -42,13 +66,16 @@ repositories {
4266
}
4367
4468
dependencies {
45-
compile 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.0.5'
69+
compile 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.3.1'
4670
4771
// to embed GraphiQL tool
48-
compile 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.0.5'
72+
compile 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.3.1'
4973
5074
// to embed Voyager tool
51-
compile 'com.graphql-java-kickstart:voyager-spring-boot-starter:5.0.5'
75+
compile 'com.graphql-java-kickstart:voyager-spring-boot-starter:5.3.1'
76+
77+
// testing facilities
78+
testCompile 'com.graphql-java-kickstart:graphql-spring-boot-starter-test:5.3.1'
5279
}
5380
```
5481

@@ -57,22 +84,31 @@ Maven:
5784
<dependency>
5885
<groupId>com.graphql-java-kickstart</groupId>
5986
<artifactId>graphql-spring-boot-starter</artifactId>
60-
<version>5.0.5</version>
87+
<version>5.3.1</version>
6188
</dependency>
6289

6390
<!-- to embed GraphiQL tool -->
6491
<dependency>
6592
<groupId>com.graphql-java-kickstart</groupId>
6693
<artifactId>graphiql-spring-boot-starter</artifactId>
67-
<version>5.0.5</version>
94+
<version>5.3.1</version>
6895
</dependency>
6996

7097
<!-- to embed Voyager tool -->
7198
<dependency>
7299
<groupId>com.graphql-java-kickstart</groupId>
73100
<artifactId>voyager-spring-boot-starter</artifactId>
74-
<version>5.0.5</version>
101+
<version>5.3.1</version>
75102
</dependency>
103+
104+
<!-- testing facilities -->
105+
<dependency>
106+
<groupId>com.graphql-java-kickstart</groupId>
107+
<artifactId>graphql-spring-boot-starter-test</artifactId>
108+
<version>5.3.1</version>
109+
<scope>test</scope>
110+
</dependency>
111+
76112
```
77113

78114
New releases will be available faster in the JCenter repository than in Maven Central. Add the following to use for Maven
@@ -104,9 +140,11 @@ Available Spring Boot configuration parameters (either `application.yml` or `app
104140
```yaml
105141
graphql:
106142
servlet:
107-
mapping: /graphql
108-
enabled: true
109-
corsEnabled: true
143+
mapping: /graphql
144+
enabled: true
145+
corsEnabled: true
146+
# if you want to @ExceptionHandler annotation for custom GraphQLErrors
147+
exception-handlers-enabled: true
110148
```
111149
112150
By default a global CORS filter is enabled for `/graphql/**` context.
@@ -166,34 +204,15 @@ Available Spring Boot configuration parameters (either `application.yml` or `app
166204
```yaml
167205
graphql:
168206
tools:
169-
schemaLocationPattern: "**/*.graphqls"
207+
schema-location-pattern: "**/*.graphqls"
170208
# Enable or disable the introspection query. Disabling it puts your server in contravention of the GraphQL
171209
# specification and expectations of most clients, so use this option with caution
172-
introspectionEnabled: true
210+
introspection-enabled: true
173211
```
174212
By default GraphQL tools uses the location pattern `**/*.graphqls` to scan for GraphQL schemas on the classpath.
175213
Use the `schemaLocationPattern` property to customize this pattern.
176214

177215

178-
## GraphQL Spring Common [LATEST SUPPORTED VERSION: 3.1.1]
179-
**https://github.com/oembedler/spring-graphql-common**
180-
181-
See the [Readme](https://github.com/oembedler/spring-graphql-common#usage) and the [example](https://github.com/graphql-java-kickstart/graphql-spring-boot/tree/master/example-spring-common) for usage instructions.
182-
183-
#### Application Properties
184-
```yaml
185-
graphql:
186-
spring-graphql-common:
187-
clientMutationIdName: clientMutationId
188-
injectClientMutationId: true
189-
allowEmptyClientMutationId: false
190-
mutationInputArgumentName: input
191-
outputObjectNamePrefix: Payload
192-
inputObjectNamePrefix: Input
193-
schemaMutationObjectName: Mutation
194-
```
195-
196-
197216
# Contributions
198217

199218
Contributions are welcome. Please respect the [Code of Conduct](http://contributor-covenant.org/version/1/3/0/).
@@ -203,8 +222,6 @@ Contributions are welcome. Please respect the [Code of Conduct](http://contribu
203222

204223
`graphql-spring-boot-starter` and `graphiql-spring-boot-starter` are licensed under the MIT License. See [LICENSE](LICENSE.md) for details.
205224

206-
[spring-graphql-common License](https://github.com/oembedler/spring-graphql-common/blob/master/LICENSE.md)
207-
208225
[graphql-java License](https://github.com/andimarek/graphql-java/blob/master/LICENSE.md)
209226

210227
[graphiql License](https://github.com/graphql/graphiql/blob/master/LICENSE)

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ buildscript {
3434

3535
plugins {
3636
id 'net.researchgate.release' version '2.7.0'
37+
id 'io.franzbecker.gradle-lombok' version '1.14' apply false
3738
}
3839

3940
subprojects {
@@ -42,6 +43,7 @@ subprojects {
4243
apply plugin: 'maven'
4344
apply plugin: 'maven-publish'
4445
apply plugin: "com.jfrog.bintray"
46+
apply plugin: 'io.franzbecker.gradle-lombok'
4547

4648
group = PROJECT_GROUP
4749

@@ -65,6 +67,14 @@ subprojects {
6567
targetCompatibility = TARGET_COMPATIBILITY
6668
}
6769

70+
compileJava.dependsOn(processResources)
71+
72+
lombok {
73+
version = "1.18.4"
74+
sha256 = ""
75+
}
76+
77+
6878
if (!it.name.startsWith('example')) {
6979

7080
jar {

example-graphql-subscription/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
sourceCompatibility = 1.8
66

77
repositories {
8+
jcenter()
89
mavenCentral()
910
}
1011

example-graphql-tools/src/main/java/com/oembedler/moon/graphql/boot/resolvers/Comment.java renamed to example-graphql-tools/src/main/java/com/graphql/sample/boot/Comment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.oembedler.moon.graphql.boot.resolvers;
1+
package com.graphql.sample.boot;
22

33
class Comment {
44

example-graphql-tools/src/main/java/com/oembedler/moon/graphql/boot/GraphQLToolsSampleApplication.java renamed to example-graphql-tools/src/main/java/com/graphql/sample/boot/GraphQLToolsSampleApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.oembedler.moon.graphql.boot;
1+
package com.graphql.sample.boot;
22

33
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
44
import graphql.servlet.ObjectMapperConfigurer;

example-graphql-tools/src/main/java/com/oembedler/moon/graphql/boot/resolvers/Mutation.java renamed to example-graphql-tools/src/main/java/com/graphql/sample/boot/Mutation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.oembedler.moon.graphql.boot.resolvers;
1+
package com.graphql.sample.boot;
22

33
import com.coxautodev.graphql.tools.GraphQLMutationResolver;
44
import java.util.Random;

example-graphql-tools/src/main/java/com/oembedler/moon/graphql/boot/resolvers/Post.java renamed to example-graphql-tools/src/main/java/com/graphql/sample/boot/Post.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.oembedler.moon.graphql.boot.resolvers;
1+
package com.graphql.sample.boot;
22

33
public class Post {
44

example-graphql-tools/src/main/java/com/oembedler/moon/graphql/boot/resolvers/PostResolver.java renamed to example-graphql-tools/src/main/java/com/graphql/sample/boot/PostResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.oembedler.moon.graphql.boot.resolvers;
1+
package com.graphql.sample.boot;
22

33
import com.coxautodev.graphql.tools.GraphQLResolver;
44
import org.springframework.stereotype.Component;

example-graphql-tools/src/main/java/com/oembedler/moon/graphql/boot/resolvers/Query.java renamed to example-graphql-tools/src/main/java/com/graphql/sample/boot/Query.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.oembedler.moon.graphql.boot.resolvers;
1+
package com.graphql.sample.boot;
22

33
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
44
import org.springframework.stereotype.Component;

example-graphql-tools/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ spring:
22
application:
33
name: graphql-java-tools-app
44
server:
5-
port: 9000
5+
port: 9001
66
graphiql:
77
headers:
88
Authorization: "Bearer 05bd9a5f3fe0408f89520946b0fe1b06"

0 commit comments

Comments
 (0)