+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 00000000..79ee123c
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/externalDependencies.xml b/.idea/externalDependencies.xml
new file mode 100644
index 00000000..68eda26b
--- /dev/null
+++ b/.idea/externalDependencies.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/google-java-format.xml b/.idea/google-java-format.xml
new file mode 100644
index 00000000..8b57f452
--- /dev/null
+++ b/.idea/google-java-format.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..07a2ef8f
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,53 @@
+# How to contribute
+
+We're really glad you're reading this, because we need more volunteer developers to help with this
+project!
+
+We can use all the help we can get on each of
+our [GraphQL Java Kickstart](https://github.com/graphql-java-kickstart)
+projects. This work ranges from adding new features, fixing bugs, and answering questions to writing
+documentation.
+
+## Answering questions and writing documentation
+
+A lot of the questions asked on GitHub are caused by a lack of documentation. We should
+strive from now on to answer questions by adding content to
+our [documentation](https://github.com/graphql-java-kickstart/documentation) and referring them to
+the newly created content.
+
+Continuous integration will make sure that the changes are automatically deployed to
+https://www.graphql-java-kickstart.com.
+
+## Submitting changes
+
+Please send a Pull Request with a clear list of what you've done using the
+[GitHub flow](https://guides.github.com/introduction/flow/). We can always use more test coverage,
+so we'd love to see that in the pull requests too. And make sure to follow our coding conventions (
+below) and make sure all your commits are atomic
+(one feature per commit).
+
+## Coding conventions
+
+We use Google Java Style guide for our projects. See the
+[Java Style Guide](https://google.github.io/styleguide/javaguide.html) for a detailed description.
+The code style is enforced in our CI workflows. This means you'll have to make sure that your
+commits have the same formatting.
+
+Best way to do this is to install the
+[google java format plugin](https://plugins.jetbrains.com/plugin/8527-google-java-format). Once
+installed you'll have to enable it for the project. From that point on you can hit CTRL+ALT+L to
+reformat the code. Or even better configure the commit options in IntelliJ IDEA to Reformat Code
+before commit:
+
+
+
+**Warning**
+There's also an XML code style file available that you could import in your IDE. That approach will
+never be exactly in line with the checks and formatting that the google-java-format plugin applies.
+
+### SonarLint
+
+It would also be very helpful to install the SonarLint plugin in your IDE and fix any relevant
+SonarLint issues before pushing a PR. We're aware that the current state of the code raises a lot of
+SonarLint issues out of the box, but any help in reducing that is appreciated. More importantly we
+don't increase that technical debt.
diff --git a/README.md b/README.md
index 1f78f2ed..8d115862 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,11 @@
# GraphQL and Graph*i*QL Spring Framework Boot Starters
[](https://maven-badges.herokuapp.com/maven-central/com.graphql-java-kickstart/graphql-spring-boot-starter)
-[](https://github.com/graphql-java-kickstart/graphql-spring-boot/actions?query=workflow%3ACI+branch%3Amaster)
+[](https://github.com/graphql-java-kickstart/graphql-spring-boot/actions/workflows/ci.yml?query=workflow%3ACI+branch%3Amaster)
[](https://sonarcloud.io/dashboard?id=graphql-java-kickstart_graphql-spring-boot)
+[](https://github.com/graphql-java-kickstart/graphql-spring-boot/graphs/contributors)
+[](https://github.com/graphql-java-kickstart/graphql-spring-boot/discussions)
+
#### We are looking for contributors!
@@ -16,7 +19,7 @@ and join the team!
**Table of Contents**
- - [WARNING: NoClassDefFoundError when using GraphQL Java Tools > 5.4.x](#warning-noclassdeffounderror-when-using-graphql-java-tools--54x)
+ - [Quick start](#quick-start)
- [Using Gradle](#using-gradle)
- [Using Maven](#using-maven)
- [Documentation](#documentation)
@@ -25,12 +28,16 @@ and join the team!
- [Enable GraphQL Servlet](#enable-graphql-servlet)
- [Enable Graph*i*QL](#enable-graphiql)
- [Enable Altair](#enable-altair)
-- [Enable GraphQL Playground](#enable-graphql-playground)
+- [Enable GraphQL Playground](#enable-graphql-voyager)
- [Basic settings](#basic-settings)
- [CDN](#cdn)
- [Custom static resources](#custom-static-resources)
- [Customizing GraphQL Playground](#customizing-graphql-playground)
- [Tabs](#tabs)
+- [Enable GraphQL Voyager](#enable-graphql-playground)
+ - [Basic settings](#graphql-voyager-basic-settings)
+ - [CDN](#graphql-voyager-cdn)
+ - [Customizing GraphQL Voyager](#customizing-graphql-voyager)
- [Supported GraphQL-Java Libraries](#supported-graphql-java-libraries)
- [GraphQL Java Tools](#graphql-java-tools)
- [GraphQL Annotations](#graphql-annotations)
@@ -42,21 +49,15 @@ and join the team!
- [Extended scalars](#extended-scalars)
- [Tracing and Metrics](#tracing-and-metrics)
- [Usage](#usage)
+- [FAQs](#faqs)
+ - [WARNING: NoClassDefFoundError when using GraphQL Java Tools > 5.4.x](#warning-noclassdeffounderror-when-using-graphql-java-tools--54x)
+
- [Contributions](#contributions)
- [Licenses](#licenses)
-## WARNING: NoClassDefFoundError when using GraphQL Java Tools > 5.4.x
-
-If you're using `graphql-java-tools` in combination with Spring Boot 2.1.x or below then you need to
-set the
-`kotlin.version` in your Spring Boot project explicitly to version >= 1.3.70, because Spring Boot
-Starter parent of that Spring Boot version overrides it with a 1.2.* version of Kotlin.
-`graphql-java-tools` requires 1.3.* however because of its coroutine support. If you don't override
-this version you will run into a `NoClassDefFoundError`.
-
-Spring Boot team has indicated the Kotlin version will be upgraded to 1.3 in Spring Boot 2.2.
+## Quick start
### Using Gradle
@@ -76,7 +77,7 @@ Set the Kotlin version in your `` section
```
-# Documentation
+## Documentation
See our new [Documentation](https://www.graphql-java-kickstart.com/spring-boot/).
@@ -84,16 +85,16 @@ Repository contains:
* `graphql-spring-boot-starter` to turn your boot application into GraphQL server (
see [graphql-java-servlet](https://github.com/graphql-java-kickstart/graphql-java-servlet))
-* `altair-spring-boot-starter`to embed `Altair` tool for schema introspection and query debugging (
+* `altair-spring-boot-starter` to embed `Altair` tool for schema introspection and query debugging (
see [altair](https://github.com/imolorhe/altair))
-* `graphiql-spring-boot-starter`to embed `GraphiQL` tool for schema introspection and query
+* `graphiql-spring-boot-starter` to embed `GraphiQL` tool for schema introspection and query
debugging (see [graphiql](https://github.com/graphql/graphiql))
-* `playground-spring-boot-starter`to embed `GraphQL Playground` tool for schema introspection and
+* `playground-spring-boot-starter` to embed `GraphQL Playground` tool for schema introspection and
query debugging (see [GraphQL Playground](https://github.com/prisma/graphql-playground))
-* `voyager-spring-boot-starter`to embed `Voyager` tool for visually explore GraphQL APIs as an
+* `voyager-spring-boot-starter` to embed `Voyager` tool for visually explore GraphQL APIs as an
interactive graph (see [voyger](https://github.com/APIs-guru/graphql-voyager))
-# Requirements and Downloads
+## Requirements and Downloads
Requirements:
@@ -104,7 +105,6 @@ Gradle:
```gradle
repositories {
- jcenter()
mavenCentral()
}
@@ -117,6 +117,9 @@ dependencies {
// to embed GraphiQL tool
runtimeOnly 'com.graphql-java-kickstart:graphiql-spring-boot-starter:11.0.0'
+ // to embed GraphQL Playground tool
+ runtimeOnly 'com.graphql-java-kickstart:playground-spring-boot-starter:11.0.0'
+
// to embed Voyager tool
runtimeOnly 'com.graphql-java-kickstart:voyager-spring-boot-starter:11.0.0'
@@ -150,6 +153,14 @@ Maven:
runtime
+
+
+ com.graphql-java-kickstart
+ playground-spring-boot-starter
+ 11.0.0
+ runtime
+
+
com.graphql-java-kickstart
@@ -168,34 +179,15 @@ Maven:
```
-New releases will be available faster in the JCenter repository than in Maven Central. Add the
-following to use for Maven
-
-```xml
-
-
- jcenter
- https://jcenter.bintray.com/
-
-
-```
-
-For Gradle:
-
-```groovy
-repositories {
- jcenter()
-}
-```
### Snapshots
```xml
- jfrog-snapshots
- oss-jfrog-artifactory-snapshots
- https://oss.jfrog.org/artifactory/oss-snapshot-local
+ osshr-snapshots
+ osshr-sonatype-snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
```
@@ -204,7 +196,7 @@ For gradle:
```groovy
repositories {
- maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
+ maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
```
@@ -266,13 +258,12 @@ graphiql:
subscriptions:
timeout: 30
reconnect: false
- static:
- basePath: /
+ basePath: /
enabled: true
pageTitle: GraphiQL
cdn:
enabled: false
- version: 0.13.0
+ version: latest
props:
resources:
query: query.graphql
@@ -446,6 +437,62 @@ You can configure the query, variables, headers and even supply sample responses
, `variables` and `responses` are expected to be resources of the appropriate format (GraphQL
for `query`, JSON for `variables` and `responses`).
+
+# Enable GraphQL Voyager
+
+**GraphQL Voyager** becomes accessible at root `/voyager` (or as configured
+in `voyager.mapping`)
+if `voyager-spring-boot-starter` is added as a dependency to a boot application.
+
+Available Spring Boot configuration parameters (either `application.yml`
+or `application.properties`):
+
+```yaml
+voyager:
+ enabled: true
+ basePath: /
+ mapping: /voyager
+ endpoint: /graphql
+ cdn:
+ enabled: false
+ version: latest
+ pageTitle: Voyager
+ displayOptions:
+ skipRelay: true
+ skipDeprecated: true
+ rootType: Query
+ sortByAlphabet: false
+ showLeafFields: true
+ hideRoot: false
+ hideDocs: false
+ hideSettings: false
+```
+
+## GraphQL Voyager Basic settings
+
+`mapping` and `endpoint` will default to `/voyager` and `/graphql`, respectively. Note that these values may not be empty.
+
+`enabled` defaults to `true`, and therefor **GraphQL Voyager** will be available by default if the dependency
+is added to a Spring Boot Web Application project.
+
+`pageTitle` defaults to `Voyager`.
+
+All other properties default to the same as documented on the official [GraphQL Voyager readme](https://github.com/APIs-guru/graphql-voyager#properties)
+
+## GraphQL Voyager CDN
+
+The currently bundled version is `1.0.0-rc31`, which is - as of writing this - the latest release
+of **GraphQL Voyager**. The CDN option uses `jsDelivr` CDN, if enabled. By default, it will
+load the latest available release. Available CDN versions can be found on the project's
+[jsDelivr page](https://www.jsdelivr.com/package/npm/graphql-voyager). The CDN option is
+disabled by default.
+
+## Customizing GraphQL Voyager
+
+Further **GraphQL Voyager** `displayOptions`, `hideDocs` and `hideSettings` customizations can be configured, as documented in the official
+[GraphQL Voyager readme](https://github.com/APIs-guru/graphql-voyager#properties).
+
+
# Supported GraphQL-Java Libraries
The following libraries have auto-configuration classes for creating a `GraphQLSchema`.
@@ -605,6 +652,22 @@ The following metrics are available for exposure:
* `graphql.websocket.sessions` - number of active websocket sessions for subscriptions
* `graphql.websocket.subscriptions` - number of active subscriptions
+
+## FAQs
+### WARNING: NoClassDefFoundError when using GraphQL Java Tools > 5.4.x
+
+If you're using `graphql-java-tools` in combination with Spring Boot 2.1.x or below then you need to
+set the
+`kotlin.version` in your Spring Boot project explicitly to version >= 1.3.70, because Spring Boot
+Starter parent of that Spring Boot version overrides it with a 1.2.* version of Kotlin.
+`graphql-java-tools` requires 1.3.* however because of its coroutine support. If you don't override
+this version you will run into a `NoClassDefFoundError`.
+
+Spring Boot team has indicated the Kotlin version will be upgraded to 1.3 in Spring Boot 2.2.
+
+
+
+
# Contributions
Contributions are welcome. Please respect
diff --git a/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairAutoConfiguration.java b/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairAutoConfiguration.java
index 6f789bc7..f2ceb991 100644
--- a/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairAutoConfiguration.java
+++ b/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairAutoConfiguration.java
@@ -8,9 +8,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;
-/**
- * @author Moncef AOUDIA
- */
+/** @author Moncef AOUDIA */
@Configuration
@ConditionalOnWebApplication
@EnableConfigurationProperties(AltairProperties.class)
@@ -22,5 +20,4 @@ public class AltairAutoConfiguration {
AltairController altairController() {
return new AltairController();
}
-
}
diff --git a/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairController.java b/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairController.java
index 3cb0280d..aaaa6cee 100644
--- a/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairController.java
+++ b/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairController.java
@@ -24,20 +24,16 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
-/**
- * @author Moncef AOUDIA
- */
+/** @author Moncef AOUDIA */
@Controller
public class AltairController {
private static final String CDN_UNPKG = "//unpkg.com/";
private static final String ALTAIR = "altair-static";
- @Autowired
- private AltairProperties altairProperties;
+ @Autowired private AltairProperties altairProperties;
- @Autowired
- private Environment environment;
+ @Autowired private Environment environment;
private String template;
private String props;
@@ -67,31 +63,36 @@ private void loadHeaders() throws JsonProcessingException {
}
@GetMapping(value = "${altair.mapping:/altair}")
- public void altair(HttpServletRequest request, HttpServletResponse response,
- @PathVariable Map params) throws IOException {
+ public void altair(
+ HttpServletRequest request,
+ HttpServletResponse response,
+ @PathVariable Map params)
+ throws IOException {
response.setContentType("text/html; charset=UTF-8");
- Map replacements = getReplacements(
- constructGraphQlEndpoint(request, params),
- request.getContextPath() + altairProperties.getEndpoint().getSubscriptions()
- );
+ Map replacements =
+ getReplacements(
+ constructGraphQlEndpoint(request, params),
+ request.getContextPath() + altairProperties.getEndpoint().getSubscriptions());
String populatedTemplate = StringSubstitutor.replace(template, replacements);
response.getOutputStream().write(populatedTemplate.getBytes(Charset.defaultCharset()));
}
- private Map getReplacements(String graphqlEndpoint,
- String subscriptionsEndpoint) {
+ private Map getReplacements(
+ String graphqlEndpoint, String subscriptionsEndpoint) {
Map replacements = new HashMap<>();
replacements.put("graphqlEndpoint", graphqlEndpoint);
replacements.put("subscriptionsEndpoint", subscriptionsEndpoint);
replacements.put("pageTitle", altairProperties.getPageTitle());
replacements.put("pageFavicon", getResourceUrl("favicon.ico", "favicon.ico"));
- replacements.put("altairBaseUrl", getResourceUrl(
- StringUtils.join(altairProperties.getBasePath(), "/vendor/altair/"),
- joinJsUnpkgPath(ALTAIR, altairProperties.getCdn().getVersion(), "build/dist/")));
- replacements
- .put("altairLogoUrl", getResourceUrl("assets/img/logo_350.svg", "assets/img/logo_350.svg"));
+ replacements.put(
+ "altairBaseUrl",
+ getResourceUrl(
+ StringUtils.join(altairProperties.getBasePath(), "/vendor/altair/"),
+ joinJsUnpkgPath(ALTAIR, altairProperties.getCdn().getVersion(), "build/dist/")));
+ replacements.put(
+ "altairLogoUrl", getResourceUrl("assets/img/logo_350.svg", "assets/img/logo_350.svg"));
replacements.put("altairCssUrl", getResourceUrl("styles.css", "styles.css"));
replacements.put("altairMainJsUrl", getResourceUrl("main.js", "main.js"));
replacements.put("altairPolyfillsJsUrl", getResourceUrl("polyfills.js", "polyfills.js"));
@@ -112,17 +113,16 @@ private String joinJsUnpkgPath(String library, String cdnVersion, String cdnFile
return CDN_UNPKG + library + "@" + cdnVersion + "/" + cdnFileName;
}
- private String constructGraphQlEndpoint(HttpServletRequest request,
- @RequestParam Map params) {
+ private String constructGraphQlEndpoint(
+ HttpServletRequest request, @RequestParam Map params) {
String endpoint = altairProperties.getEndpoint().getGraphql();
for (Map.Entry param : params.entrySet()) {
endpoint = endpoint.replaceAll("\\{" + param.getKey() + "}", param.getValue());
}
- if (StringUtils.isNotBlank(request.getContextPath()) && !endpoint
- .startsWith(request.getContextPath())) {
+ if (StringUtils.isNotBlank(request.getContextPath())
+ && !endpoint.startsWith(request.getContextPath())) {
return request.getContextPath() + endpoint;
}
return endpoint;
}
-
}
diff --git a/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairProperties.java b/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairProperties.java
index 8c5384de..df141f0f 100644
--- a/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairProperties.java
+++ b/altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairProperties.java
@@ -27,5 +27,4 @@ static class Cdn {
private boolean enabled = false;
private String version = "2.4.11";
}
-
}
diff --git a/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AbstractAutoConfigurationTest.java b/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AbstractAutoConfigurationTest.java
index 264e9001..fc68d69e 100644
--- a/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AbstractAutoConfigurationTest.java
+++ b/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AbstractAutoConfigurationTest.java
@@ -1,15 +1,12 @@
package graphql.kickstart.altair.boot.test;
-import lombok.NonNull;
import org.junit.jupiter.api.AfterEach;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.AnnotationConfigRegistry;
import org.springframework.context.support.AbstractApplicationContext;
-/**
- * @author Moncef AOUDIA
- */
+/** @author Moncef AOUDIA */
public abstract class AbstractAutoConfigurationTest {
private final Class extends AbstractApplicationContext> contextClass;
@@ -21,8 +18,8 @@ protected AbstractAutoConfigurationTest(Class> autoConfiguration) {
this(AnnotationConfigApplicationContext.class, autoConfiguration);
}
- protected AbstractAutoConfigurationTest(Class extends AbstractApplicationContext> contextClass,
- Class> autoConfiguration) {
+ protected AbstractAutoConfigurationTest(
+ Class extends AbstractApplicationContext> contextClass, Class> autoConfiguration) {
assert AnnotationConfigRegistry.class.isAssignableFrom(contextClass);
this.contextClass = contextClass;
this.autoConfiguration = autoConfiguration;
diff --git a/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AltairControllerTest.java b/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AltairControllerTest.java
index 15f01497..07bbee05 100644
--- a/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AltairControllerTest.java
+++ b/altair-spring-boot-autoconfigure/src/test/java/graphql/kickstart/altair/boot/test/AltairControllerTest.java
@@ -14,9 +14,7 @@
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
class AltairControllerTest extends AbstractAutoConfigurationTest {
public AltairControllerTest() {
diff --git a/build.gradle b/build.gradle
index 128bd07a..526d30b9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,12 +21,11 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
- id "com.jfrog.bintray" version "$LIB_BINTRAY_PLUGIN_VER" apply false
- id 'net.researchgate.release' version "$LIB_RELEASE_PLUGIN_VER"
id "org.springframework.boot" version "$LIB_SPRING_BOOT_VER" apply false
- id "com.jfrog.artifactory" version "4.15.1" apply false
- id "org.sonarqube" version "3.0"
+ id "org.sonarqube" version "$PLUGIN_SONARQUBE_VER"
id "jacoco"
+ id 'io.codearte.nexus-staging' version "$PLUGIN_NEXUS_STAGING_VER"
+ id 'com.github.sherter.google-java-format' version "$PLUGIN_GOOGLE_JAVA_FORMAT_VER" apply false
}
sonarqube {
@@ -37,83 +36,89 @@ sonarqube {
}
}
+def bomProjectName = "graphql-spring-boot-dependencies"
+
subprojects {
apply plugin: 'idea'
- apply plugin: 'jacoco'
- apply plugin: 'org.sonarqube'
- apply plugin: 'java'
- apply plugin: 'java-library'
+ if (it.name != bomProjectName) {
+ apply plugin: 'jacoco'
+ apply plugin: 'org.sonarqube'
+ apply plugin: 'java'
+ apply plugin: 'java-library'
+ apply plugin: "io.spring.dependency-management"
+ }
apply plugin: 'maven-publish'
- apply plugin: "com.jfrog.bintray"
- apply plugin: "io.spring.dependency-management"
- apply plugin: 'com.jfrog.artifactory'
+ apply plugin: 'signing'
+ apply plugin: 'com.github.sherter.google-java-format'
group "$PROJECT_GROUP"
repositories {
mavenLocal()
mavenCentral()
- jcenter()
- maven { url "https://dl.bintray.com/graphql-java-kickstart/releases" }
maven { url "https://repo.spring.io/libs-milestone" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
}
- dependencyManagement {
- imports {
- mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER"
+ if (it.name != bomProjectName) {
+ dependencyManagement {
+ imports {
+ mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER"
+ }
}
- }
- dependencies {
- compileOnly "org.projectlombok:lombok"
- annotationProcessor "org.projectlombok:lombok"
+ dependencies {
+ compileOnly "org.projectlombok:lombok"
+ annotationProcessor "org.projectlombok:lombok"
- testCompileOnly "org.projectlombok:lombok"
- testAnnotationProcessor "org.projectlombok:lombok"
- }
+ testCompileOnly "org.projectlombok:lombok"
+ testAnnotationProcessor "org.projectlombok:lombok"
+ }
- test {
- useJUnitPlatform()
- testLogging {
- events TestLogEvent.FAILED,
- TestLogEvent.PASSED,
- TestLogEvent.SKIPPED,
- TestLogEvent.STANDARD_ERROR,
- TestLogEvent.STANDARD_OUT
- exceptionFormat TestExceptionFormat.FULL
- showCauses true
- showExceptions true
- showStackTraces true
+ test {
+ useJUnitPlatform()
+ testLogging {
+ events TestLogEvent.FAILED,
+ TestLogEvent.PASSED,
+ TestLogEvent.SKIPPED,
+ TestLogEvent.STANDARD_ERROR,
+ TestLogEvent.STANDARD_OUT
+ exceptionFormat TestExceptionFormat.FULL
+ showCauses true
+ showExceptions true
+ showStackTraces true
+ }
}
- }
- jacoco {
- toolVersion = "0.8.7-SNAPSHOT"
- }
+ jacoco {
+ toolVersion = "$PLUGIN_JACOCO_VER"
+ }
- jacocoTestReport {
- reports {
- xml.enabled = true
- html.enabled = false
- csv.enabled = false
+ jacocoTestReport {
+ reports {
+ xml.enabled = true
+ html.enabled = false
+ csv.enabled = false
+ }
}
- }
- idea {
- module {
- downloadJavadoc = true
- downloadSources = true
+ idea {
+ module {
+ downloadJavadoc = true
+ downloadSources = true
+ }
}
- }
- compileJava {
- sourceCompatibility = SOURCE_COMPATIBILITY
- targetCompatibility = TARGET_COMPATIBILITY
- }
+ compileJava {
+ sourceCompatibility = SOURCE_COMPATIBILITY
+ targetCompatibility = TARGET_COMPATIBILITY
+ }
+
+ compileJava.dependsOn(processResources)
- compileJava.dependsOn(processResources)
+ compileJava.mustRunAfter verifyGoogleJavaFormat
+ }
if (!it.name.startsWith('example')) {
@@ -122,19 +127,33 @@ subprojects {
enabled = false
}
- jar {
- from "LICENSE.md"
+ if (it.name != bomProjectName) {
+ jar {
+ from "LICENSE.md"
+ }
+
+ java {
+ withSourcesJar()
+ withJavadocJar()
+ }
}
- java {
- withSourcesJar()
- withJavadocJar()
+ if (!version.toString().endsWith('-SNAPSHOT')) {
+ ext["signing.keyId"] = System.env.SIGNING_KEY_ID
+ ext["signing.password"] = System.env.SIGNING_PASSWORD
+ ext["signing.secretKeyRingFile"] = System.env.SIGNING_SECRET_KEY_RING_FILE
+
+ signing {
+ sign publishing.publications
+ }
}
publishing {
publications {
- mainProjectPublication(MavenPublication) {
- from components.java
+ mavenJava(MavenPublication) {
+ if (project.name != bomProjectName) {
+ from components.java
+ }
// to avoid "Publication only contains dependencies and/or constraints without a version" error
// see https://docs.gradle.org/6.2.1/userguide/publishing_maven.html#publishing_maven:resolved_dependencies
@@ -148,7 +167,6 @@ subprojects {
}
pom {
- resolveStrategy = DELEGATE_FIRST
name = PROJECT_NAME
description = PROJECT_DESC
url = PROJECT_GIT_REPO_URL
@@ -173,83 +191,27 @@ subprojects {
}
}
}
- }
-
- bintray {
- user = System.env.BINTRAY_USER ?: project.findProperty('BINTRAY_USER') ?: ''
- key = System.env.BINTRAY_PASS ?: project.findProperty('BINTRAY_PASS') ?: ''
- publications = ['mainProjectPublication']
- publish = true
- pkg {
- repo = 'releases'
- name = PROJECT_NAME
- desc = PROJECT_DESC
- licenses = [PROJECT_LICENSE]
- vcsUrl = PROJECT_GIT_REPO_URL
- userOrg = 'graphql-java-kickstart'
- version {
- name = project.version
- gpg {
- sign = true
+ repositories {
+ maven {
+ name 'ossrh'
+ if (version.toString().endsWith("-SNAPSHOT")) {
+ url "https://oss.sonatype.org/content/repositories/snapshots/"
+ } else {
+ url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
}
- mavenCentralSync {
- user = System.env.OSS_USER_TOKEN_KEY ?: project.findProperty('OSS_USER_TOKEN_KEY') ?: ''
+ credentials {
+ username = System.env.OSS_USER_TOKEN_KEY ?: project.findProperty('OSS_USER_TOKEN_KEY') ?: ''
password = System.env.OSS_USER_TOKEN_PASS ?: project.findProperty('OSS_USER_TOKEN_PASS') ?: ''
}
}
}
}
-
- artifactory {
- contextUrl = 'https://oss.jfrog.org'
- publish {
- repository {
- if (project.version.endsWith("-SNAPSHOT")) {
- repoKey = 'oss-snapshot-local'
- } else {
- repoKey = 'oss-release-local'
- }
- username = System.env.BINTRAY_USER ?: project.findProperty('BINTRAY_USER') ?: ''
- password = System.env.BINTRAY_PASS ?: project.findProperty('BINTRAY_PASS') ?: ''
- }
- defaults {
- publications('mainProjectPublication')
- publishArtifacts = true
- publishPom = true
- }
- }
- resolve {
- repoKey = 'oss-snapshot-local'
- }
- clientConfig.info.setBuildNumber(System.getProperty('build.number'))
- }
}
}
-release {
- tagTemplate = 'v${version}'
- failOnPublishNeeded = false
- ignoredSnapshotDependencies = [
- 'com.graphql-java-kickstart:altair-spring-boot-autoconfigure',
- 'com.graphql-java-kickstart:altair-spring-boot-starter',
- 'com.graphql-java-kickstart:graphiql-spring-boot-autoconfigure',
- 'com.graphql-java-kickstart:graphiql-spring-boot-starter',
- 'com.graphql-java-kickstart:graphql-spring-boot-autoconfigure',
- 'com.graphql-java-kickstart:graphql-spring-boot-starter',
- 'com.graphql-java-kickstart:graphql-spring-boot-starter-test',
- 'com.graphql-java-kickstart:graphql-spring-boot-test',
- 'com.graphql-java-kickstart:graphql-spring-boot-test-autoconfigure',
- 'com.graphql-java-kickstart:voyager-spring-boot-autoconfigure',
- 'com.graphql-java-kickstart:voyager-spring-boot-starter',
- 'com.graphql-java-kickstart:playground-spring-boot-autoconfigure',
- 'com.graphql-java-kickstart:playground-spring-boot-starter'
- ]
-}
-
-task build {
- dependsOn subprojects.findResults { it.tasks.findByName('assemble') }
- dependsOn subprojects.findResults { it.tasks.findByName('check') }
- dependsOn subprojects.findResults { it.tasks.findByName('bintray') }
+nexusStaging {
+ username = System.env.OSS_USER_TOKEN_KEY ?: project.findProperty('OSS_USER_TOKEN_KEY') ?: ''
+ password = System.env.OSS_USER_TOKEN_PASS ?: project.findProperty('OSS_USER_TOKEN_PASS') ?: ''
}
wrapper {
diff --git a/example-graphql-subscription/build.gradle b/example-graphql-subscription/build.gradle
index 3f028f41..313a6d8c 100644
--- a/example-graphql-subscription/build.gradle
+++ b/example-graphql-subscription/build.gradle
@@ -3,6 +3,7 @@ apply plugin: "org.springframework.boot"
dependencies {
implementation(project(":graphql-spring-boot-starter"))
implementation(project(":graphiql-spring-boot-starter"))
+ implementation(project(":playground-spring-boot-starter"))
implementation "com.graphql-java-kickstart:graphql-java-tools:$LIB_GRAPHQL_JAVA_TOOLS_VER"
implementation "io.reactivex.rxjava2:rxjava"
@@ -13,6 +14,5 @@ dependencies {
}
jar.enabled = false
-uploadArchives.enabled = false
-bintrayUpload.enabled = false
+publish.enabled = false
publishToMavenLocal.enabled = false
diff --git a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/SubscriptionSampleApplication.java b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/SubscriptionSampleApplication.java
index e397803c..3c01bc99 100644
--- a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/SubscriptionSampleApplication.java
+++ b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/SubscriptionSampleApplication.java
@@ -9,5 +9,4 @@ public class SubscriptionSampleApplication {
public static void main(String[] args) {
SpringApplication.run(SubscriptionSampleApplication.class, args);
}
-
}
diff --git a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerReactorPublisher.java b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerReactorPublisher.java
index c37636c4..85df1f30 100644
--- a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerReactorPublisher.java
+++ b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerReactorPublisher.java
@@ -37,10 +37,13 @@ public class StockTickerReactorPublisher {
private final Flux publisher;
public StockTickerReactorPublisher() {
- Flux stockPriceUpdateFlux = Flux.create(emitter -> {
- ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
- executorService.scheduleAtFixedRate(newStockTick(emitter), 0, 2, TimeUnit.SECONDS);
- }, FluxSink.OverflowStrategy.BUFFER);
+ Flux stockPriceUpdateFlux =
+ Flux.create(
+ emitter -> {
+ ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
+ executorService.scheduleAtFixedRate(newStockTick(emitter), 0, 2, TimeUnit.SECONDS);
+ },
+ FluxSink.OverflowStrategy.BUFFER);
ConnectableFlux connectableFlux = stockPriceUpdateFlux.share().publish();
connectableFlux.connect();
@@ -72,8 +75,8 @@ private Runnable newStockTick(FluxSink emitter) {
};
}
- private void emitStocks(FluxSink emitter,
- List stockPriceUpdates) {
+ private void emitStocks(
+ FluxSink emitter, List stockPriceUpdates) {
for (StockPriceUpdate stockPriceUpdate : stockPriceUpdates) {
try {
emitter.next(stockPriceUpdate);
@@ -89,8 +92,8 @@ public Flux getPublisher() {
public Flux getPublisher(List stockCodes) {
if (stockCodes != null) {
- return publisher
- .filter(stockPriceUpdate -> stockCodes.contains(stockPriceUpdate.getStockCode()));
+ return publisher.filter(
+ stockPriceUpdate -> stockCodes.contains(stockPriceUpdate.getStockCode()));
}
return publisher;
}
@@ -119,5 +122,4 @@ private StockPriceUpdate rollUpdate() {
CURRENT_STOCK_PRICES.put(stockCode, newPrice);
return new StockPriceUpdate(stockCode, LocalDateTime.now(), newPrice, incrementDollars);
}
-
}
diff --git a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerRxPublisher.java b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerRxPublisher.java
index 11d4b906..52204fd5 100644
--- a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerRxPublisher.java
+++ b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/publishers/StockTickerRxPublisher.java
@@ -39,15 +39,15 @@ public class StockTickerRxPublisher {
private final Flowable publisher;
public StockTickerRxPublisher() {
- Observable stockPriceUpdateObservable = Observable.create(emitter -> {
-
- ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
- executorService.scheduleAtFixedRate(newStockTick(emitter), 0, 2, TimeUnit.SECONDS);
-
- });
-
- ConnectableObservable connectableObservable = stockPriceUpdateObservable
- .share().publish();
+ Observable stockPriceUpdateObservable =
+ Observable.create(
+ emitter -> {
+ ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
+ executorService.scheduleAtFixedRate(newStockTick(emitter), 0, 2, TimeUnit.SECONDS);
+ });
+
+ ConnectableObservable connectableObservable =
+ stockPriceUpdateObservable.share().publish();
connectableObservable.connect();
publisher = connectableObservable.toFlowable(BackpressureStrategy.BUFFER);
@@ -76,8 +76,8 @@ private Runnable newStockTick(ObservableEmitter emitter) {
};
}
- private void emitStocks(ObservableEmitter emitter,
- List stockPriceUpdates) {
+ private void emitStocks(
+ ObservableEmitter emitter, List stockPriceUpdates) {
for (StockPriceUpdate stockPriceUpdate : stockPriceUpdates) {
try {
emitter.onNext(stockPriceUpdate);
@@ -93,8 +93,8 @@ public Flowable getPublisher() {
public Flowable getPublisher(List stockCodes) {
if (stockCodes != null) {
- return publisher
- .filter(stockPriceUpdate -> stockCodes.contains(stockPriceUpdate.getStockCode()));
+ return publisher.filter(
+ stockPriceUpdate -> stockCodes.contains(stockPriceUpdate.getStockCode()));
}
return publisher;
}
@@ -123,5 +123,4 @@ private StockPriceUpdate rollUpdate() {
CURRENT_STOCK_PRICES.put(stockCode, newPrice);
return new StockPriceUpdate(stockCode, LocalDateTime.now(), newPrice, incrementDollars);
}
-
}
diff --git a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Query.java b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Query.java
index a94a2485..f1680ec9 100644
--- a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Query.java
+++ b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Query.java
@@ -11,5 +11,4 @@ class Query implements GraphQLQueryResolver {
String hello() {
return HELLO;
}
-
}
diff --git a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/StockPriceUpdate.java b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/StockPriceUpdate.java
index 232b6e1d..6508fc36 100644
--- a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/StockPriceUpdate.java
+++ b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/StockPriceUpdate.java
@@ -11,7 +11,10 @@ public class StockPriceUpdate {
private final BigDecimal stockPrice;
private final BigDecimal stockPriceChange;
- public StockPriceUpdate(String stockCode, LocalDateTime dateTime, BigDecimal stockPrice,
+ public StockPriceUpdate(
+ String stockCode,
+ LocalDateTime dateTime,
+ BigDecimal stockPrice,
BigDecimal stockPriceChange) {
this.stockCode = stockCode;
this.dateTime = dateTime.format(DateTimeFormatter.ISO_DATE_TIME);
diff --git a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Subscription.java b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Subscription.java
index 122ae7df..e8654d8e 100644
--- a/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Subscription.java
+++ b/example-graphql-subscription/src/main/java/graphql/kickstart/spring/web/boot/resolvers/Subscription.java
@@ -18,5 +18,4 @@ class Subscription implements GraphQLSubscriptionResolver {
Publisher stockQuotes(List stockCodes) {
return stockTickerPublisher.getPublisher(stockCodes);
}
-
}
diff --git a/example-graphql-subscription/src/main/resources/public/index.html b/example-graphql-subscription/src/main/resources/public/index.html
index 3a8ab927..69beb433 100644
--- a/example-graphql-subscription/src/main/resources/public/index.html
+++ b/example-graphql-subscription/src/main/resources/public/index.html
@@ -43,7 +43,7 @@
-
+
diff --git a/example-graphql-tools/build.gradle b/example-graphql-tools/build.gradle
index 110c7c69..dba360b4 100644
--- a/example-graphql-tools/build.gradle
+++ b/example-graphql-tools/build.gradle
@@ -32,6 +32,5 @@ dependencies {
}
jar.enabled = false
-uploadArchives.enabled = false
-bintrayUpload.enabled = false
+publish.enabled = false
publishToMavenLocal.enabled = false
diff --git a/example-graphql-tools/src/main/java/com/graphql/sample/boot/Comment.java b/example-graphql-tools/src/main/java/com/graphql/sample/boot/Comment.java
index 94d6febf..e3786329 100644
--- a/example-graphql-tools/src/main/java/com/graphql/sample/boot/Comment.java
+++ b/example-graphql-tools/src/main/java/com/graphql/sample/boot/Comment.java
@@ -9,5 +9,4 @@ class Comment {
private Long id;
private String description;
-
}
diff --git a/example-graphql-tools/src/main/java/com/graphql/sample/boot/GraphQLToolsSampleApplication.java b/example-graphql-tools/src/main/java/com/graphql/sample/boot/GraphQLToolsSampleApplication.java
index 97e55f58..7b68eb89 100644
--- a/example-graphql-tools/src/main/java/com/graphql/sample/boot/GraphQLToolsSampleApplication.java
+++ b/example-graphql-tools/src/main/java/com/graphql/sample/boot/GraphQLToolsSampleApplication.java
@@ -9,5 +9,4 @@ public class GraphQLToolsSampleApplication {
public static void main(String[] args) {
SpringApplication.run(GraphQLToolsSampleApplication.class, args);
}
-
}
diff --git a/example-graphql-tools/src/main/java/com/graphql/sample/boot/Mutation.java b/example-graphql-tools/src/main/java/com/graphql/sample/boot/Mutation.java
index cad837a2..c62cac77 100644
--- a/example-graphql-tools/src/main/java/com/graphql/sample/boot/Mutation.java
+++ b/example-graphql-tools/src/main/java/com/graphql/sample/boot/Mutation.java
@@ -12,5 +12,4 @@ public Post createPost(String text) {
post.setText(text);
return post;
}
-
}
diff --git a/example-graphql-tools/src/main/java/com/graphql/sample/boot/PostResolver.java b/example-graphql-tools/src/main/java/com/graphql/sample/boot/PostResolver.java
index d19ecc70..a3f8bdf9 100644
--- a/example-graphql-tools/src/main/java/com/graphql/sample/boot/PostResolver.java
+++ b/example-graphql-tools/src/main/java/com/graphql/sample/boot/PostResolver.java
@@ -22,5 +22,4 @@ class PostResolver implements GraphQLResolver {
public List getComments(Post post) {
return Optional.ofNullable(comments.get(post.getId())).orElseGet(Collections::emptyList);
}
-
}
diff --git a/example-graphql-tools/src/main/java/com/graphql/sample/boot/Query.java b/example-graphql-tools/src/main/java/com/graphql/sample/boot/Query.java
index 7a3af309..74dfb584 100644
--- a/example-graphql-tools/src/main/java/com/graphql/sample/boot/Query.java
+++ b/example-graphql-tools/src/main/java/com/graphql/sample/boot/Query.java
@@ -9,5 +9,4 @@ class Query implements GraphQLQueryResolver {
Post getPost(Long id) {
return new Post(id);
}
-
}
diff --git a/example-graphql-tools/src/test/java/com/graphql/sample/boot/GraphQLToolsSampleApplicationTest.java b/example-graphql-tools/src/test/java/com/graphql/sample/boot/GraphQLToolsSampleApplicationTest.java
index 3155356b..7c3a2848 100644
--- a/example-graphql-tools/src/test/java/com/graphql/sample/boot/GraphQLToolsSampleApplicationTest.java
+++ b/example-graphql-tools/src/test/java/com/graphql/sample/boot/GraphQLToolsSampleApplicationTest.java
@@ -20,13 +20,12 @@
@GraphQLTest
class GraphQLToolsSampleApplicationTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
void get_comments() throws IOException {
- GraphQLResponse response = graphQLTestTemplate
- .postForResource("graphql/post-get-comments.graphql");
+ GraphQLResponse response =
+ graphQLTestTemplate.postForResource("graphql/post-get-comments.graphql");
assertNotNull(response);
assertThat(response.isOk()).isTrue();
assertThat(response.get("$.data.post.id")).isEqualTo("1");
@@ -36,8 +35,9 @@ void get_comments() throws IOException {
void get_comments_withFragments() throws IOException {
List fragments = new ArrayList<>();
fragments.add("graphql/all-comment-fields-fragment.graphql");
- GraphQLResponse response = graphQLTestTemplate
- .postForResource("graphql/post-get-comments-with-fragment.graphql", fragments);
+ GraphQLResponse response =
+ graphQLTestTemplate.postForResource(
+ "graphql/post-get-comments-with-fragment.graphql", fragments);
assertNotNull(response);
assertThat((response.isOk())).isTrue();
assertThat(response.get("$.data.post.id")).isEqualTo("1");
@@ -47,10 +47,9 @@ void get_comments_withFragments() throws IOException {
void create_post() throws IOException {
ObjectNode variables = new ObjectMapper().createObjectNode();
variables.put("text", "lorem ipsum dolor sit amet");
- GraphQLResponse response = graphQLTestTemplate
- .perform("graphql/create-post.graphql", variables);
+ GraphQLResponse response =
+ graphQLTestTemplate.perform("graphql/create-post.graphql", variables);
assertThat(response).isNotNull();
assertThat(response.get("$.data.createPost.id")).isNotNull();
}
-
}
diff --git a/example-request-scoped-dataloader/build.gradle b/example-request-scoped-dataloader/build.gradle
index a5e89641..d6cda098 100644
--- a/example-request-scoped-dataloader/build.gradle
+++ b/example-request-scoped-dataloader/build.gradle
@@ -12,6 +12,5 @@ dependencies {
}
jar.enabled = false
-uploadArchives.enabled = false
-bintrayUpload.enabled = false
-publishToMavenLocal.enabled = false
\ No newline at end of file
+publish.enabled = false
+publishToMavenLocal.enabled = false
diff --git a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/Application.java b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/Application.java
index 2816b331..a049d748 100644
--- a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/Application.java
+++ b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/Application.java
@@ -10,5 +10,4 @@ public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
-
}
diff --git a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomGraphQLContextBuilder.java b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomGraphQLContextBuilder.java
index 8c78ab48..69d490f0 100644
--- a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomGraphQLContextBuilder.java
+++ b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomGraphQLContextBuilder.java
@@ -27,7 +27,8 @@ public CustomGraphQLContextBuilder(CustomerRepository customerRepository) {
@Override
public GraphQLContext build(HttpServletRequest req, HttpServletResponse response) {
return DefaultGraphQLServletContext.createServletContext(buildDataLoaderRegistry(), null)
- .with(req).with(response)
+ .with(req)
+ .with(response)
.build();
}
@@ -40,14 +41,15 @@ public GraphQLContext build() {
public GraphQLContext build(Session session, HandshakeRequest request) {
return DefaultGraphQLWebSocketContext.createWebSocketContext(buildDataLoaderRegistry(), null)
.with(session)
- .with(request).build();
+ .with(request)
+ .build();
}
private DataLoaderRegistry buildDataLoaderRegistry() {
DataLoaderRegistry dataLoaderRegistry = new DataLoaderRegistry();
- DataLoader customerLoader = new DataLoader<>(
- customerIds -> supplyAsync(() -> customerRepository.getUserNamesForIds(customerIds))
- );
+ DataLoader customerLoader =
+ new DataLoader<>(
+ customerIds -> supplyAsync(() -> customerRepository.getUserNamesForIds(customerIds)));
dataLoaderRegistry.register("customerDataLoader", customerLoader);
return dataLoaderRegistry;
}
diff --git a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomerResolver.java b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomerResolver.java
index 58fb22c9..196a99fa 100644
--- a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomerResolver.java
+++ b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/CustomerResolver.java
@@ -19,5 +19,4 @@ public CompletableFuture getName(Customer customer, DataFetchingEnvironm
}
throw new IllegalStateException("No customer data loader found");
}
-
}
diff --git a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/WalmartQueryResolver.java b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/WalmartQueryResolver.java
index 3f24f942..187ce007 100644
--- a/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/WalmartQueryResolver.java
+++ b/example-request-scoped-dataloader/src/main/java/graphql/servlet/examples/dataloader/requestscope/WalmartQueryResolver.java
@@ -19,8 +19,8 @@ public WalmartQueryResolver() {
}
public List walmartCustomers(int storeNumber) {
- return walmartData.get(storeNumber).parallelStream().map(Customer::new)
+ return walmartData.get(storeNumber).parallelStream()
+ .map(Customer::new)
.collect(Collectors.toList());
}
-
}
diff --git a/example-request-scoped-dataloader/src/test/java/graphql/servlet/examples/dataloader/requestscope/ApplicationTest.java b/example-request-scoped-dataloader/src/test/java/graphql/servlet/examples/dataloader/requestscope/ApplicationTest.java
index 167e3286..6af4caa3 100644
--- a/example-request-scoped-dataloader/src/test/java/graphql/servlet/examples/dataloader/requestscope/ApplicationTest.java
+++ b/example-request-scoped-dataloader/src/test/java/graphql/servlet/examples/dataloader/requestscope/ApplicationTest.java
@@ -18,11 +18,9 @@
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class ApplicationTest {
- @Autowired
- private TestRestTemplate restTemplate;
+ @Autowired private TestRestTemplate restTemplate;
- @Autowired
- private CustomerRepository repository;
+ @Autowired private CustomerRepository repository;
@Test
void testSanity() {
@@ -33,28 +31,31 @@ void testSanity() {
@Test
void testRequestScope() {
- String requestGraphQL = "query {\n" +
- " walmartCustomers(storeNumber:4177){\n" +
- " customerId\n" +
- " name\n" +
- " }\n" +
- "}";
+ String requestGraphQL =
+ "query {\n"
+ + " walmartCustomers(storeNumber:4177){\n"
+ + " customerId\n"
+ + " name\n"
+ + " }\n"
+ + "}";
HttpHeaders headers = new HttpHeaders();
headers.add("content-type", "application/graphql");
- ResponseEntity response = this.restTemplate
- .postForEntity("/graphql", new HttpEntity<>(requestGraphQL, headers), JsonNode.class);
+ ResponseEntity response =
+ this.restTemplate.postForEntity(
+ "/graphql", new HttpEntity<>(requestGraphQL, headers), JsonNode.class);
- assertThat(response.getBody()).hasToString(
- "{\"data\":{\"walmartCustomers\":[{\"customerId\":101,\"name\":\"Customer Name 1\"},{\"customerId\":102,\"name\":\"Customer Name 2\"},{\"customerId\":103,\"name\":\"Customer Name 3\"},{\"customerId\":104,\"name\":\"Customer Name 4\"}]}}");
+ assertThat(response.getBody())
+ .hasToString(
+ "{\"data\":{\"walmartCustomers\":[{\"customerId\":101,\"name\":\"Customer Name 1\"},{\"customerId\":102,\"name\":\"Customer Name 2\"},{\"customerId\":103,\"name\":\"Customer Name 3\"},{\"customerId\":104,\"name\":\"Customer Name 4\"}]}}");
repository.updateUsernameForId(101, "New Name 1");
- response = this.restTemplate
- .postForEntity("/graphql", new HttpEntity<>(requestGraphQL, headers), JsonNode.class);
+ response =
+ this.restTemplate.postForEntity(
+ "/graphql", new HttpEntity<>(requestGraphQL, headers), JsonNode.class);
- assertThat(response.getBody()).hasToString(
- "{\"data\":{\"walmartCustomers\":[{\"customerId\":101,\"name\":\"New Name 1\"},{\"customerId\":102,\"name\":\"Customer Name 2\"},{\"customerId\":103,\"name\":\"Customer Name 3\"},{\"customerId\":104,\"name\":\"Customer Name 4\"}]}}");
+ assertThat(response.getBody())
+ .hasToString(
+ "{\"data\":{\"walmartCustomers\":[{\"customerId\":101,\"name\":\"New Name 1\"},{\"customerId\":102,\"name\":\"Customer Name 2\"},{\"customerId\":103,\"name\":\"Customer Name 3\"},{\"customerId\":104,\"name\":\"Customer Name 4\"}]}}");
}
-
-
}
diff --git a/example-spring-common/build.gradle b/example-spring-common/build.gradle
index ddb74e64..32a5917d 100644
--- a/example-spring-common/build.gradle
+++ b/example-spring-common/build.gradle
@@ -24,7 +24,7 @@ dependencies {
implementation(project(":graphiql-spring-boot-starter"))
implementation "com.embedler.moon.graphql:spring-graphql-common:2.1.0-2016-05-22T16-50-32"
- implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.3'
+ implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.4'
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
@@ -33,6 +33,5 @@ dependencies {
}
jar.enabled = false
-uploadArchives.enabled = false
-bintrayUpload.enabled = false
+publish.enabled = false
publishToMavenLocal.enabled = false
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java
index ef5f21d2..7e2f721a 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java
@@ -22,9 +22,7 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
@SpringBootApplication
public class ApplicationBootConfiguration {
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/SimpleListConnection.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/SimpleListConnection.java
index bde31747..6d09fae7 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/SimpleListConnection.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/SimpleListConnection.java
@@ -11,9 +11,7 @@
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class SimpleListConnection {
@@ -22,7 +20,9 @@ public abstract class SimpleListConnection {
public abstract > E createEdgeObject();
- public abstract , ? extends PageInfoObjectType>> C createConnectionObject();
+ public abstract <
+ C extends ConnectionObjectType extends EdgeObjectType, ? extends PageInfoObjectType>>
+ C createConnectionObject();
private List> buildEdges() {
List> edges = new ArrayList<>();
@@ -36,8 +36,8 @@ private List> buildEdges() {
return edges;
}
- public , ? extends PageInfoObjectType>> C get(
- DataFetchingEnvironment environment) {
+ public , ? extends PageInfoObjectType>>
+ C get(DataFetchingEnvironment environment) {
List> edges = buildEdges();
int afterOffset = getOffsetFromCursor(environment.getArgument("after"), -1);
@@ -76,7 +76,8 @@ private List> buildEdges() {
pageInfo.setHasPreviousPage(!firstEdge.getCursor().equals(firstPresliceCursor));
pageInfo.setHasNextPage(!lastEdge.getCursor().equals(lastPresliceCursor));
- ConnectionObjectType, PageInfoObjectType> connection = createConnectionObject();
+ ConnectionObjectType, PageInfoObjectType> connection =
+ createConnectionObject();
connection.setEdges(edges);
connection.setPageInfo(pageInfo);
@@ -84,8 +85,11 @@ private List> buildEdges() {
return (C) connection;
}
- private , ? extends PageInfoObjectType>> E emptyConnection() {
- ConnectionObjectType, PageInfoObjectType> connection = createConnectionObject();
+ private <
+ E extends ConnectionObjectType extends EdgeObjectType, ? extends PageInfoObjectType>>
+ E emptyConnection() {
+ ConnectionObjectType, PageInfoObjectType> connection =
+ createConnectionObject();
connection.setPageInfo(new PageInfoObjectType());
//noinspection unchecked
return (E) connection;
@@ -95,8 +99,8 @@ private int getOffsetFromCursor(String cursor, int defaultValue) {
if (cursor == null) {
return defaultValue;
}
- String string = new String(java.util.Base64.getDecoder().decode(cursor),
- StandardCharsets.UTF_8);
+ String string =
+ new String(java.util.Base64.getDecoder().decode(cursor), StandardCharsets.UTF_8);
return Integer.parseInt(string.substring(DUMMY_CURSOR_PREFIX.length()));
}
@@ -104,5 +108,4 @@ private String createCursor(int offset) {
byte[] lala = (DUMMY_CURSOR_PREFIX + offset).getBytes(StandardCharsets.UTF_8);
return Base64.getEncoder().encodeToString(lala);
}
-
}
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/TodoSimpleListConnection.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/TodoSimpleListConnection.java
index a25397f8..04569065 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/TodoSimpleListConnection.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/TodoSimpleListConnection.java
@@ -5,9 +5,7 @@
import graphql.kickstart.spring.web.boot.sample.schema.objecttype.TodoObjectType.TodoEdgeObjectType;
import java.util.List;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
@SuppressWarnings("unchecked")
public class TodoSimpleListConnection extends SimpleListConnection {
@@ -24,5 +22,4 @@ public TodoEdgeObjectType createEdgeObject() {
public TodoConnectionObjectType createConnectionObject() {
return new TodoObjectType.TodoConnectionObjectType();
}
-
}
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/TodoSchema.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/TodoSchema.java
index 88f6a582..8c7e1367 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/TodoSchema.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/TodoSchema.java
@@ -39,8 +39,7 @@
@GraphQLSchema
public class TodoSchema {
- @GraphQLSchemaQuery
- private RootObjectType root;
+ @GraphQLSchemaQuery private RootObjectType root;
private UserObjectType theOnlyUser = new UserObjectType();
private List todos = new ArrayList<>();
@@ -48,7 +47,6 @@ public class TodoSchema {
private TodoSimpleListConnection simpleConnectionTodo;
private int nextTodoId = 0;
-
public TodoSchema() {
addTodo("Do Something");
addTodo("Other todo");
@@ -79,20 +77,24 @@ public void renameTodo(String id, String text) {
}
public List removeCompletedTodos() {
- List toDelete = todos.stream()
- .filter(TodoObjectType::isComplete)
- .map(todoObjectType -> todoObjectType.getId(todoObjectType))
- .collect(Collectors.toList());
+ List toDelete =
+ todos.stream()
+ .filter(TodoObjectType::isComplete)
+ .map(todoObjectType -> todoObjectType.getId(todoObjectType))
+ .collect(Collectors.toList());
todos.removeIf(todo -> toDelete.contains(todo.getId(todo)));
return toDelete;
}
public List markAllTodos(boolean complete) {
List changed = new ArrayList<>();
- todos.stream().filter(todo -> complete != todo.isComplete()).forEach(todo -> {
- changed.add(todo.getId(todo));
- todo.setComplete(complete);
- });
+ todos.stream()
+ .filter(todo -> complete != todo.isComplete())
+ .forEach(
+ todo -> {
+ changed.add(todo.getId(todo));
+ todo.setComplete(complete);
+ });
return changed;
}
@@ -110,7 +112,8 @@ public TodoObjectType getTodo(String id) {
}
public List getTodos(List ids) {
- return todos.stream().filter(todo -> ids.contains(todo.getId(todo)))
+ return todos.stream()
+ .filter(todo -> ids.contains(todo.getId(todo)))
.collect(Collectors.toList());
}
@@ -118,16 +121,13 @@ public UserObjectType getTheOnlyUser() {
return theOnlyUser;
}
-
public TodoSimpleListConnection getSimpleConnectionTodo() {
return simpleConnectionTodo;
}
@GraphQLMutation
@GraphQLDescription("Mutation to add new todo item")
- public
- @GraphQLOut("todoEdge")
- TodoObjectType.TodoEdgeObjectType addTodoMutation(
+ public @GraphQLOut("todoEdge") TodoObjectType.TodoEdgeObjectType addTodoMutation(
@GraphQLIn("addTodoInput") AddTodoIn addTodoInput) {
TodoObjectType.TodoEdgeObjectType todoEdgeObjectType = new TodoObjectType.TodoEdgeObjectType();
@@ -143,11 +143,11 @@ TodoObjectType.TodoEdgeObjectType addTodoMutation(
// --- mutations
@GraphQLMutation
- public
- @GraphQLOut("filename")
- String uploadFile(GraphQLServletContext graphQLContext) {
- return graphQLContext.getParts().values().stream().flatMap(Collection::stream)
- .map(Part::getName).collect(Collectors.joining(", "));
+ public @GraphQLOut("filename") String uploadFile(GraphQLServletContext graphQLContext) {
+ return graphQLContext.getParts().values().stream()
+ .flatMap(Collection::stream)
+ .map(Part::getName)
+ .collect(Collectors.joining(", "));
}
@GraphQLMutation
@@ -167,5 +167,4 @@ public void setText(String text) {
this.text = text;
}
}
-
}
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/BaseObjectType.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/BaseObjectType.java
index 98376f80..cf924d02 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/BaseObjectType.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/BaseObjectType.java
@@ -23,13 +23,10 @@
import com.oembedler.moon.graphql.engine.stereotype.GraphQLIgnore;
import graphql.relay.Relay;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
public class BaseObjectType implements RelayNode {
- @GraphQLIgnore
- private String id;
+ @GraphQLIgnore private String id;
public String getId(RelayNode relayNode) {
BaseObjectType baseObjectType = (BaseObjectType) relayNode;
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/RootObjectType.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/RootObjectType.java
index 9ef007ff..0b210c1f 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/RootObjectType.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/RootObjectType.java
@@ -30,9 +30,7 @@
import graphql.kickstart.spring.web.boot.sample.schema.TodoSchema;
import org.springframework.beans.factory.annotation.Autowired;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
@GraphQLObject("Root")
public class RootObjectType {
@@ -41,9 +39,7 @@ public class RootObjectType {
@GraphQLDescription("Root query version number")
public static final String VERSION = "0.9.0.2";
- @Autowired
- @GraphQLIgnore
- private TodoSchema todoSchema;
+ @Autowired @GraphQLIgnore private TodoSchema todoSchema;
@GraphQLField
public UserObjectType viewer() {
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/TodoObjectType.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/TodoObjectType.java
index 35753d74..b89c33ff 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/TodoObjectType.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/TodoObjectType.java
@@ -24,9 +24,7 @@
import com.oembedler.moon.graphql.engine.relay.PageInfoObjectType;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLObject;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
@GraphQLObject("Todo")
public class TodoObjectType extends BaseObjectType {
@@ -50,14 +48,9 @@ public void setComplete(boolean complete) {
}
@GraphQLObject
- public static class TodoConnectionObjectType extends
- ConnectionObjectType {
-
- }
+ public static class TodoConnectionObjectType
+ extends ConnectionObjectType {}
@GraphQLObject
- public static class TodoEdgeObjectType extends EdgeObjectType {
-
- }
-
+ public static class TodoEdgeObjectType extends EdgeObjectType {}
}
diff --git a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/UserObjectType.java b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/UserObjectType.java
index d5885e6d..3cc4ffca 100644
--- a/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/UserObjectType.java
+++ b/example-spring-common/src/main/java/graphql/kickstart/spring/web/boot/sample/schema/objecttype/UserObjectType.java
@@ -27,15 +27,11 @@
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
@GraphQLObject("User")
public class UserObjectType extends BaseObjectType {
- @Autowired
- @GraphQLIgnore
- private TodoSchema todoSchema;
+ @Autowired @GraphQLIgnore private TodoSchema todoSchema;
private String name = "someId";
@@ -48,12 +44,12 @@ public void setName(String name) {
}
@GraphQLField
- public TodoObjectType.TodoConnectionObjectType todos(@GraphQLIn("before") String before,
+ public TodoObjectType.TodoConnectionObjectType todos(
+ @GraphQLIn("before") String before,
@GraphQLIn("after") String after,
@GraphQLIn(value = "first", defaultSpel = "1") Integer first,
@GraphQLIn(value = "last", defaultProvider = "1") Integer last,
DataFetchingEnvironment environment) {
return todoSchema.getSimpleConnectionTodo().get(environment);
}
-
}
diff --git a/example-webflux/build.gradle b/example-webflux/build.gradle
index 64556854..c182df41 100644
--- a/example-webflux/build.gradle
+++ b/example-webflux/build.gradle
@@ -23,12 +23,12 @@ dependencies {
implementation(project(":graphql-kickstart-spring-boot-starter-webflux"))
implementation(project(":graphql-kickstart-spring-boot-starter-tools"))
implementation(project(":voyager-spring-boot-starter"))
+ implementation(project(":playground-spring-boot-starter"))
implementation("org.springframework.boot:spring-boot-starter-webflux:$LIB_SPRING_BOOT_VER")
implementation("org.springframework.boot:spring-boot-starter-actuator:$LIB_SPRING_BOOT_VER")
}
jar.enabled = false
-uploadArchives.enabled = false
-bintrayUpload.enabled = false
+publish.enabled = false
publishToMavenLocal.enabled = false
diff --git a/example-webflux/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationWebfluxConfiguration.java b/example-webflux/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationWebfluxConfiguration.java
index cb6bf8d4..31da7c8e 100644
--- a/example-webflux/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationWebfluxConfiguration.java
+++ b/example-webflux/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationWebfluxConfiguration.java
@@ -30,9 +30,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.web.reactive.config.EnableWebFlux;
-/**
- * @author Max Günther
- */
+/** @author Max Günther */
@SpringBootApplication
@EnableWebFlux
public class ApplicationWebfluxConfiguration {
@@ -45,16 +43,15 @@ public static void main(String[] args) {
GraphQLSchema schema() {
DataFetcher test = env -> "response";
return GraphQLSchema.newSchema()
- .query(GraphQLObjectType.newObject()
- .name("query")
- .field(field -> field
- .name("test")
- .type(Scalars.GraphQLString)
- )
- .build())
- .codeRegistry(GraphQLCodeRegistry.newCodeRegistry()
- .dataFetcher(FieldCoordinates.coordinates("query", "test"), test)
- .build())
+ .query(
+ GraphQLObjectType.newObject()
+ .name("query")
+ .field(field -> field.name("test").type(Scalars.GraphQLString))
+ .build())
+ .codeRegistry(
+ GraphQLCodeRegistry.newCodeRegistry()
+ .dataFetcher(FieldCoordinates.coordinates("query", "test"), test)
+ .build())
.build();
}
}
diff --git a/example/build.gradle b/example/build.gradle
index 679121eb..b864f538 100644
--- a/example/build.gradle
+++ b/example/build.gradle
@@ -31,6 +31,5 @@ dependencies {
}
jar.enabled = false
-uploadArchives.enabled = false
-bintrayUpload.enabled = false
+publish.enabled = false
publishToMavenLocal.enabled = false
diff --git a/example/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java b/example/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java
index 538db443..208693c6 100644
--- a/example/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java
+++ b/example/src/main/java/graphql/kickstart/spring/web/boot/sample/ApplicationBootConfiguration.java
@@ -40,16 +40,15 @@ public static void main(String[] args) {
GraphQLSchema schema() {
DataFetcher test = env -> "response";
return GraphQLSchema.newSchema()
- .query(GraphQLObjectType.newObject()
- .name("query")
- .field(field -> field
- .name("test")
- .type(Scalars.GraphQLString)
- )
- .build())
- .codeRegistry(GraphQLCodeRegistry.newCodeRegistry()
- .dataFetcher(FieldCoordinates.coordinates("query", "test"), test)
- .build())
+ .query(
+ GraphQLObjectType.newObject()
+ .name("query")
+ .field(field -> field.name("test").type(Scalars.GraphQLString))
+ .build())
+ .codeRegistry(
+ GraphQLCodeRegistry.newCodeRegistry()
+ .dataFetcher(FieldCoordinates.coordinates("query", "test"), test)
+ .build())
.build();
}
}
diff --git a/github-build.sh b/github-build.sh
index 2f083bdd..6e9d498f 100644
--- a/github-build.sh
+++ b/github-build.sh
@@ -42,10 +42,10 @@ commitNextVersion() {
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
-echo "Deploying release to Bintray"
+echo "Deploying release to Maven Central"
removeSnapshots
-./gradlew clean assemble && ./gradlew bintrayUpload -x check --info
+./gradlew clean build publish closeAndReleaseRepository -x verifyGoogleJavaFormat
commitRelease
bumpVersion
diff --git a/gradle.properties b/gradle.properties
index ecabe910..afb3b439 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -32,18 +32,18 @@ SOURCE_COMPATIBILITY=1.8
TARGET_COMPATIBILITY=1.8
### Dependencies
LIB_GRAPHQL_JAVA_VER=16.2
-LIB_EXTENDED_SCALARS_VERSION=16.0.0
-LIB_SPRING_BOOT_VER=2.4.3
+LIB_EXTENDED_SCALARS_VER=16.0.1
+LIB_SPRING_BOOT_VER=2.4.5
LIB_GRAPHQL_SERVLET_VER=11.1.0
-LIB_GRAPHQL_JAVA_TOOLS_VER=11.0.0
+LIB_GRAPHQL_JAVA_TOOLS_VER=11.0.1
LIB_GRAPHQL_ANNOTATIONS_VER=8.3
LIB_REFLECTIONS_VER=0.9.11
-LIB_APACHE_COMMONS_TEXT=1.8
+LIB_APACHE_COMMONS_TEXT=1.9
LIB_JSOUP_VER=1.13.1
-### Gradle Plugins
-LIB_BINTRAY_PLUGIN_VER=1.8.5
-LIB_RELEASE_PLUGIN_VER=2.8.1
+### Plugins
+PLUGIN_JACOCO_VER=0.8.7-SNAPSHOT
+PLUGIN_SONARQUBE_VER=3.2.0
+PLUGIN_NEXUS_STAGING_VER=0.30.0
+PLUGIN_GOOGLE_JAVA_FORMAT_VER=0.9
###
org.gradle.daemon=true
-bintray.user=USER
-bintray.key=KEY
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 1c4bcc29..3c4101c3 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLController.java b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLController.java
index d26277ec..5e4334fa 100644
--- a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLController.java
+++ b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLController.java
@@ -21,9 +21,7 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
@Slf4j
public abstract class GraphiQLController {
@@ -32,11 +30,9 @@ public abstract class GraphiQLController {
private static final String GRAPHIQL = "graphiql";
private static final String FAVICON_GRAPHQL_ORG = "//graphql.org/img/favicon.png";
- @Autowired
- private Environment environment;
+ @Autowired private Environment environment;
- @Autowired
- private GraphiQLProperties graphiQLProperties;
+ @Autowired private GraphiQLProperties graphiQLProperties;
private String template;
private String props;
@@ -55,8 +51,9 @@ private void loadTemplate() throws IOException {
}
private void loadProps() throws IOException {
- props = new PropsLoader(environment, "graphiql.props.resources.", "graphiql.props.variables.")
- .load();
+ props =
+ new PropsLoader(environment, "graphiql.props.resources.", "graphiql.props.variables.")
+ .load();
}
private void loadHeaders() {
@@ -64,65 +61,91 @@ private void loadHeaders() {
headerProperties = propertyReader.load();
}
- public byte[] graphiql(String contextPath, @PathVariable Map params,
- Object csrf) {
+ public byte[] graphiql(
+ String contextPath, @PathVariable Map params, Object csrf) {
if (csrf != null) {
CsrfToken csrfToken = (CsrfToken) csrf;
headerProperties.setProperty(csrfToken.getHeaderName(), csrfToken.getToken());
}
- Map replacements = getReplacements(
- constructGraphQlEndpoint(contextPath, params),
- contextPath + graphiQLProperties.getEndpoint().getSubscriptions(),
- contextPath + graphiQLProperties.getBasePath()
- );
+ Map replacements =
+ getReplacements(
+ constructGraphQlEndpoint(contextPath, params),
+ contextPath + graphiQLProperties.getEndpoint().getSubscriptions(),
+ contextPath + graphiQLProperties.getBasePath());
String populatedTemplate = StringSubstitutor.replace(template, replacements);
return populatedTemplate.getBytes(Charset.defaultCharset());
}
private Map getReplacements(
- String graphqlEndpoint,
- String subscriptionsEndpoint,
- String staticBasePath
- ) {
+ String graphqlEndpoint, String subscriptionsEndpoint, String staticBasePath) {
Map replacements = new HashMap<>();
replacements.put("graphqlEndpoint", graphqlEndpoint);
replacements.put("subscriptionsEndpoint", subscriptionsEndpoint);
replacements.put("staticBasePath", staticBasePath);
replacements.put("pageTitle", graphiQLProperties.getPageTitle());
- replacements
- .put("pageFavicon", getResourceUrl(staticBasePath, "favicon.ico", FAVICON_GRAPHQL_ORG));
- replacements.put("es6PromiseJsUrl", getResourceUrl(staticBasePath, "es6-promise.auto.min.js",
- joinCdnjsPath("es6-promise", "4.1.1", "es6-promise.auto.min.js")));
- replacements.put("fetchJsUrl", getResourceUrl(staticBasePath, "fetch.min.js",
- joinCdnjsPath("fetch", "2.0.4", "fetch.min.js")));
- replacements.put("reactJsUrl", getResourceUrl(staticBasePath, "react.min.js",
- joinCdnjsPath("react", "16.8.3", "umd/react.production.min.js")));
- replacements.put("reactDomJsUrl", getResourceUrl(staticBasePath, "react-dom.min.js",
- joinCdnjsPath("react-dom", "16.8.3", "umd/react-dom.production.min.js")));
- replacements.put("graphiqlCssUrl", getResourceUrl(staticBasePath, "graphiql.min.css",
- joinJsDelivrPath(GRAPHIQL, graphiQLProperties.getCdn().getVersion(), "graphiql.css")));
- replacements.put("graphiqlJsUrl", getResourceUrl(staticBasePath, "graphiql.min.js",
- joinJsDelivrPath(GRAPHIQL, graphiQLProperties.getCdn().getVersion(), "graphiql.min.js")));
- replacements.put("subscriptionsTransportWsBrowserClientUrl", getResourceUrl(staticBasePath,
- "subscriptions-transport-ws-browser-client.js",
- joinJsDelivrPath("subscriptions-transport-ws", "0.8.3", "browser/client.js")));
- replacements.put("graphiqlSubscriptionsFetcherBrowserClientUrl", getResourceUrl(staticBasePath,
- "graphiql-subscriptions-fetcher-browser-client.js",
- joinJsDelivrPath("graphiql-subscriptions-fetcher", "0.0.2", "browser/client.js")));
+ replacements.put(
+ "pageFavicon", getResourceUrl(staticBasePath, "favicon.ico", FAVICON_GRAPHQL_ORG));
+ replacements.put(
+ "es6PromiseJsUrl",
+ getResourceUrl(
+ staticBasePath,
+ "es6-promise.auto.min.js",
+ joinCdnjsPath("es6-promise", "4.1.1", "es6-promise.auto.min.js")));
+ replacements.put(
+ "fetchJsUrl",
+ getResourceUrl(
+ staticBasePath, "fetch.min.js", joinCdnjsPath("fetch", "2.0.4", "fetch.min.js")));
+ replacements.put(
+ "reactJsUrl",
+ getResourceUrl(
+ staticBasePath,
+ "react.min.js",
+ joinCdnjsPath("react", "16.8.3", "umd/react.production.min.js")));
+ replacements.put(
+ "reactDomJsUrl",
+ getResourceUrl(
+ staticBasePath,
+ "react-dom.min.js",
+ joinCdnjsPath("react-dom", "16.8.3", "umd/react-dom.production.min.js")));
+ replacements.put(
+ "graphiqlCssUrl",
+ getResourceUrl(
+ staticBasePath,
+ "graphiql.min.css",
+ joinJsDelivrPath(GRAPHIQL, graphiQLProperties.getCdn().getVersion(), "graphiql.css")));
+ replacements.put(
+ "graphiqlJsUrl",
+ getResourceUrl(
+ staticBasePath,
+ "graphiql.min.js",
+ joinJsDelivrPath(
+ GRAPHIQL, graphiQLProperties.getCdn().getVersion(), "graphiql.min.js")));
+ replacements.put(
+ "subscriptionsTransportWsBrowserClientUrl",
+ getResourceUrl(
+ staticBasePath,
+ "subscriptions-transport-ws-browser-client.js",
+ joinJsDelivrPath("subscriptions-transport-ws", "0.8.3", "browser/client.js")));
+ replacements.put(
+ "graphiqlSubscriptionsFetcherBrowserClientUrl",
+ getResourceUrl(
+ staticBasePath,
+ "graphiql-subscriptions-fetcher-browser-client.js",
+ joinJsDelivrPath("graphiql-subscriptions-fetcher", "0.0.2", "browser/client.js")));
replacements.put("props", props);
try {
replacements.put("headers", new ObjectMapper().writeValueAsString(headerProperties));
} catch (JsonProcessingException e) {
log.error("Cannot serialize headers", e);
}
- replacements
- .put("subscriptionClientTimeout",
- String.valueOf(graphiQLProperties.getSubscriptions().getTimeout() * 1000));
- replacements
- .put("subscriptionClientReconnect",
- String.valueOf(graphiQLProperties.getSubscriptions().isReconnect()));
+ replacements.put(
+ "subscriptionClientTimeout",
+ String.valueOf(graphiQLProperties.getSubscriptions().getTimeout() * 1000));
+ replacements.put(
+ "subscriptionClientReconnect",
+ String.valueOf(graphiQLProperties.getSubscriptions().isReconnect()));
replacements.put("editorThemeCss", getEditorThemeCssURL());
return replacements;
}
@@ -132,9 +155,7 @@ private String getEditorThemeCssURL() {
if (theme != null) {
return String.format(
"https://cdnjs.cloudflare.com/ajax/libs/codemirror/%s/theme/%s.min.css",
- graphiQLProperties.getCodeMirror().getVersion(),
- theme.split("\\s")[0]
- );
+ graphiQLProperties.getCodeMirror().getVersion(), theme.split("\\s")[0]);
}
return "";
}
@@ -158,8 +179,8 @@ private String joinJsDelivrPath(String library, String cdnVersion, String cdnFil
return CDN_JSDELIVR_NET_NPM + library + "@" + cdnVersion + "/" + cdnFileName;
}
- private String constructGraphQlEndpoint(String contextPath,
- @RequestParam Map params) {
+ private String constructGraphQlEndpoint(
+ String contextPath, @RequestParam Map params) {
String endpoint = graphiQLProperties.getEndpoint().getGraphql();
for (Map.Entry param : params.entrySet()) {
endpoint = endpoint.replaceAll("\\{" + param.getKey() + "}", param.getValue());
@@ -169,5 +190,4 @@ private String constructGraphQlEndpoint(String contextPath,
}
return endpoint;
}
-
}
diff --git a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLProperties.java b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLProperties.java
index 85b69d7a..ae1d6980 100644
--- a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLProperties.java
+++ b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/GraphiQLProperties.java
@@ -34,9 +34,7 @@ static class Props {
private GraphiQLVariables variables = new GraphiQLVariables();
- /**
- * See https://github.com/graphql/graphiql/tree/main/packages/graphiql#props
- */
+ /** See https://github.com/graphql/graphiql/tree/main/packages/graphiql#props */
@Data
static class GraphiQLVariables {
diff --git a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLController.java b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLController.java
index 7b114bfb..78513457 100644
--- a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLController.java
+++ b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLController.java
@@ -27,13 +27,15 @@ public void onceConstructed() throws IOException {
}
@GetMapping(value = "${graphiql.mapping:/graphiql}")
- public Mono graphiql(ServerHttpRequest request, ServerHttpResponse response,
+ public Mono graphiql(
+ ServerHttpRequest request,
+ ServerHttpResponse response,
@PathVariable Map params) {
response.getHeaders().setContentType(MediaType.TEXT_HTML);
Object csrf = request.getQueryParams().getFirst("_csrf");
- return response.writeWith(Mono.just(request.getPath().contextPath().value())
- .map(contextPath -> super.graphiql(contextPath, params, csrf))
- .map(dataBufferFactory::wrap));
+ return response.writeWith(
+ Mono.just(request.getPath().contextPath().value())
+ .map(contextPath -> super.graphiql(contextPath, params, csrf))
+ .map(dataBufferFactory::wrap));
}
-
}
diff --git a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ServletGraphiQLController.java b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ServletGraphiQLController.java
index bb126c71..0098519e 100644
--- a/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ServletGraphiQLController.java
+++ b/graphiql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/graphiql/boot/ServletGraphiQLController.java
@@ -10,9 +10,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
@Slf4j
@Controller
public class ServletGraphiQLController extends GraphiQLController {
@@ -24,12 +22,14 @@ public void onceConstructed() throws IOException {
}
@GetMapping(value = "${graphiql.mapping:/graphiql}")
- public void graphiql(HttpServletRequest request, HttpServletResponse response,
- @PathVariable Map params) throws IOException {
+ public void graphiql(
+ HttpServletRequest request,
+ HttpServletResponse response,
+ @PathVariable Map params)
+ throws IOException {
response.setContentType("text/html; charset=UTF-8");
Object csrf = request.getAttribute("_csrf");
byte[] graphiqlBytes = super.graphiql(request.getContextPath(), params, csrf);
response.getOutputStream().write(graphiqlBytes);
}
-
}
diff --git a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLControllerTest.java b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLControllerTest.java
index 41aa1679..5632a910 100644
--- a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLControllerTest.java
+++ b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ReactiveGraphiQLControllerTest.java
@@ -15,22 +15,22 @@
@WebFluxTest
class ReactiveGraphiQLControllerTest {
- @Autowired
- private WebTestClient webTestClient;
+ @Autowired private WebTestClient webTestClient;
@Test
void shouldBeAbleToAccessGraphiQL() {
- webTestClient.get()
+ webTestClient
+ .get()
.uri("/graphiql")
.exchange()
- .expectStatus().is2xxSuccessful()
- .expectHeader().contentType(MediaType.TEXT_HTML);
+ .expectStatus()
+ .is2xxSuccessful()
+ .expectHeader()
+ .contentType(MediaType.TEXT_HTML);
}
@SpringBootConfiguration
@TestPropertySource(properties = "graphiql.enabled=true")
@Import(GraphiQLAutoConfiguration.class)
- public static class ReactiveTestApplication {
-
- }
+ public static class ReactiveTestApplication {}
}
diff --git a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ServletGraphiQLControllerTest.java b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ServletGraphiQLControllerTest.java
index 1dce4a81..64d6b4f7 100644
--- a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ServletGraphiQLControllerTest.java
+++ b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/ServletGraphiQLControllerTest.java
@@ -18,12 +18,12 @@
@WebMvcTest
class ServletGraphiQLControllerTest {
- @Autowired
- private MockMvc mockMvc;
+ @Autowired private MockMvc mockMvc;
@Test
void shouldBeAbleToAccessGraphiQL() throws Exception {
- mockMvc.perform(get("/graphiql"))
+ mockMvc
+ .perform(get("/graphiql"))
.andExpect(status().is2xxSuccessful())
.andExpect(content().contentType("text/html; charset=UTF-8"));
}
@@ -31,7 +31,5 @@ void shouldBeAbleToAccessGraphiQL() throws Exception {
@SpringBootConfiguration
@TestPropertySource(properties = "graphiql.enabled=true")
@Import(GraphiQLAutoConfiguration.class)
- public static class ServletTestApplication {
-
- }
+ public static class ServletTestApplication {}
}
diff --git a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/AbstractAutoConfigurationTest.java b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/AbstractAutoConfigurationTest.java
index 84a15326..c944649c 100644
--- a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/AbstractAutoConfigurationTest.java
+++ b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/AbstractAutoConfigurationTest.java
@@ -6,9 +6,7 @@
import org.springframework.context.annotation.AnnotationConfigRegistry;
import org.springframework.context.support.AbstractApplicationContext;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
public abstract class AbstractAutoConfigurationTest {
private final Class extends AbstractApplicationContext> contextClass;
@@ -20,8 +18,8 @@ protected AbstractAutoConfigurationTest(Class> autoConfiguration) {
this(AnnotationConfigApplicationContext.class, autoConfiguration);
}
- protected AbstractAutoConfigurationTest(Class extends AbstractApplicationContext> contextClass,
- Class> autoConfiguration) {
+ protected AbstractAutoConfigurationTest(
+ Class extends AbstractApplicationContext> contextClass, Class> autoConfiguration) {
assert AnnotationConfigRegistry.class.isAssignableFrom(contextClass);
this.contextClass = contextClass;
this.autoConfiguration = autoConfiguration;
diff --git a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/GraphiQLControllerTest.java b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/GraphiQLControllerTest.java
index e6f87630..6e187d27 100644
--- a/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/GraphiQLControllerTest.java
+++ b/graphiql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/graphiql/boot/test/GraphiQLControllerTest.java
@@ -14,9 +14,7 @@
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
class GraphiQLControllerTest extends AbstractAutoConfigurationTest {
public GraphiQLControllerTest() {
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsAutoConfiguration.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsAutoConfiguration.java
index 803c8feb..544dbed4 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsAutoConfiguration.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsAutoConfiguration.java
@@ -57,10 +57,14 @@ public GraphQLInterfaceTypeResolver graphQLInterfaceTypeResolver() {
public GraphQLAnnotations graphQLAnnotations() {
GraphQLAnnotations graphQLAnnotations = new GraphQLAnnotations();
if (nonNull(graphQLAnnotationsProperties.getInputPrefix())) {
- graphQLAnnotations.getContainer().setInputPrefix(graphQLAnnotationsProperties.getInputPrefix());
+ graphQLAnnotations
+ .getContainer()
+ .setInputPrefix(graphQLAnnotationsProperties.getInputPrefix());
}
if (nonNull(graphQLAnnotationsProperties.getInputSuffix())) {
- graphQLAnnotations.getContainer().setInputSuffix(graphQLAnnotationsProperties.getInputSuffix());
+ graphQLAnnotations
+ .getContainer()
+ .setInputSuffix(graphQLAnnotationsProperties.getInputSuffix());
}
return graphQLAnnotations;
}
@@ -69,27 +73,37 @@ public GraphQLAnnotations graphQLAnnotations() {
public GraphQLSchema graphQLSchema(final GraphQLAnnotations graphQLAnnotations) {
log.info(
"Using GraphQL Annotations library to build the schema. Schema definition files will be ignored.");
- log.info("GraphQL classes are searched in the following package (including subpackages): {}",
+ log.info(
+ "GraphQL classes are searched in the following package (including subpackages): {}",
graphQLAnnotationsProperties.getBasePackage());
final AnnotationsSchemaCreator.Builder builder = newAnnotationsSchema();
- final Reflections reflections = new Reflections(graphQLAnnotationsProperties.getBasePackage(),
- new MethodAnnotationsScanner(), new SubTypesScanner(), new TypeAnnotationsScanner());
+ final Reflections reflections =
+ new Reflections(
+ graphQLAnnotationsProperties.getBasePackage(),
+ new MethodAnnotationsScanner(),
+ new SubTypesScanner(),
+ new TypeAnnotationsScanner());
builder.setAlwaysPrettify(graphQLAnnotationsProperties.isAlwaysPrettify());
setQueryResolverClass(builder, reflections);
setMutationResolverClass(builder, reflections);
setSubscriptionResolverClass(builder, reflections);
- getTypesAnnotatedWith(reflections, GraphQLDirectiveDefinition.class).forEach(directive -> {
- log.info("Registering directive {}", directive);
- builder.directive(directive);
- });
- getTypesAnnotatedWith(reflections, GraphQLTypeExtension.class).forEach(typeExtension -> {
- log.info("Registering type extension {}", typeExtension);
- builder.typeExtension(typeExtension);
- });
- typeFunctions.forEach(typeFunction -> {
- log.info("Registering type function {}", typeFunction.getClass());
- builder.typeFunction(typeFunction);
- });
+ getTypesAnnotatedWith(reflections, GraphQLDirectiveDefinition.class)
+ .forEach(
+ directive -> {
+ log.info("Registering directive {}", directive);
+ builder.directive(directive);
+ });
+ getTypesAnnotatedWith(reflections, GraphQLTypeExtension.class)
+ .forEach(
+ typeExtension -> {
+ log.info("Registering type extension {}", typeExtension);
+ builder.typeExtension(typeExtension);
+ });
+ typeFunctions.forEach(
+ typeFunction -> {
+ log.info("Registering type function {}", typeFunction.getClass());
+ builder.typeFunction(typeFunction);
+ });
if (!customScalarTypes.isEmpty()) {
builder.typeFunction(new GraphQLScalarTypeFunction(customScalarTypes));
}
@@ -99,60 +113,64 @@ public GraphQLSchema graphQLSchema(final GraphQLAnnotations graphQLAnnotations)
log.info("Using custom annotation process of type {}", graphQLAnnotations.getClass());
}
builder.setAnnotationsProcessor(graphQLAnnotations);
- relay.ifPresent(r -> {
- log.info("Registering relay {}", r.getClass());
- builder.setRelay(r);
- });
+ relay.ifPresent(
+ r -> {
+ log.info("Registering relay {}", r.getClass());
+ builder.setRelay(r);
+ });
registerGraphQLInterfaceImplementations(reflections, builder);
return builder.build();
}
private void setSubscriptionResolverClass(
- final AnnotationsSchemaCreator.Builder builder,
- final Reflections reflections
- ) {
- final Set> subscriptionResolvers
- = getTypesAnnotatedWith(reflections, GraphQLSubscriptionResolver.class);
+ final AnnotationsSchemaCreator.Builder builder, final Reflections reflections) {
+ final Set> subscriptionResolvers =
+ getTypesAnnotatedWith(reflections, GraphQLSubscriptionResolver.class);
if (subscriptionResolvers.size() > 1) {
throw new MultipleSubscriptionResolversException();
}
- subscriptionResolvers.stream().findFirst().ifPresent(subscriptionClass -> {
- log.info("Registering subscription resolver class: {}", subscriptionClass);
- builder.subscription(subscriptionClass);
- });
+ subscriptionResolvers.stream()
+ .findFirst()
+ .ifPresent(
+ subscriptionClass -> {
+ log.info("Registering subscription resolver class: {}", subscriptionClass);
+ builder.subscription(subscriptionClass);
+ });
}
private void setMutationResolverClass(
- final AnnotationsSchemaCreator.Builder builder,
- final Reflections reflections
- ) {
- final Set> mutationResolvers
- = getTypesAnnotatedWith(reflections, GraphQLMutationResolver.class);
+ final AnnotationsSchemaCreator.Builder builder, final Reflections reflections) {
+ final Set> mutationResolvers =
+ getTypesAnnotatedWith(reflections, GraphQLMutationResolver.class);
if (mutationResolvers.size() > 1) {
throw new MultipleMutationResolversException();
}
- mutationResolvers.stream().findFirst().ifPresent(mutationClass -> {
- log.info("Registering mutation resolver class: {}", mutationClass);
- builder.mutation(mutationClass);
- });
+ mutationResolvers.stream()
+ .findFirst()
+ .ifPresent(
+ mutationClass -> {
+ log.info("Registering mutation resolver class: {}", mutationClass);
+ builder.mutation(mutationClass);
+ });
}
private void setQueryResolverClass(
- final AnnotationsSchemaCreator.Builder builder,
- final Reflections reflections
- ) {
- final Set> queryResolvers
- = getTypesAnnotatedWith(reflections, GraphQLQueryResolver.class);
+ final AnnotationsSchemaCreator.Builder builder, final Reflections reflections) {
+ final Set> queryResolvers =
+ getTypesAnnotatedWith(reflections, GraphQLQueryResolver.class);
if (queryResolvers.isEmpty()) {
throw new MissingQueryResolverException();
}
if (queryResolvers.size() > 1) {
throw new MultipleQueryResolversException();
}
- queryResolvers.stream().findFirst().ifPresent(queryClass -> {
- log.info("Registering query resolver class: {}", queryClass);
- builder.query(queryClass);
- });
+ queryResolvers.stream()
+ .findFirst()
+ .ifPresent(
+ queryClass -> {
+ log.info("Registering query resolver class: {}", queryClass);
+ builder.query(queryClass);
+ });
}
/**
@@ -162,12 +180,10 @@ private void setQueryResolverClass(
* @param reflections the {@link Reflections} instance
* @param annotation the annotation class
* @return The set of classes annotated with the specified annotation, or an empty set if no
- * annotated classes found.
+ * annotated classes found.
*/
private Set> getTypesAnnotatedWith(
- final Reflections reflections,
- final Class extends Annotation> annotation
- ) {
+ final Reflections reflections, final Class extends Annotation> annotation) {
try {
return reflections.getTypesAnnotatedWith(annotation);
} catch (ReflectionsException e) {
@@ -179,30 +195,32 @@ private Set> getTypesAnnotatedWith(
* This is required, because normally implementations of interfaces are not explicitly returned by
* any resolver method, and therefor not added to the schema automatically.
*
- * All interfaces are considered GraphQL interfaces if they are declared in the configured package
- * and have at least one {@link GraphQLField}-annotated methods.
+ *
All interfaces are considered GraphQL interfaces if they are declared in the configured
+ * package and have at least one {@link GraphQLField}-annotated methods.
*
* @param reflections the reflections instance.
* @param builder the schema builder instance.
*/
private void registerGraphQLInterfaceImplementations(
- final Reflections reflections,
- final AnnotationsSchemaCreator.Builder builder
- ) {
+ final Reflections reflections, final AnnotationsSchemaCreator.Builder builder) {
Predicate> implementationQualifiesForInclusion =
- type -> !(graphQLAnnotationsProperties.isIgnoreAbstractInterfaceImplementations()
+ type ->
+ !(graphQLAnnotationsProperties.isIgnoreAbstractInterfaceImplementations()
&& Modifier.isAbstract(type.getModifiers()));
reflections.getMethodsAnnotatedWith(GraphQLField.class).stream()
.map(Method::getDeclaringClass)
.filter(Class::isInterface)
- .forEach(graphQLInterface ->
- reflections.getSubTypesOf(graphQLInterface).stream()
- .filter(implementationQualifiesForInclusion)
- .forEach(implementation -> {
- log.info("Registering {} as an implementation of GraphQL interface {}",
- implementation,
- graphQLInterface);
- builder.additionalType(implementation);
- }));
+ .forEach(
+ graphQLInterface ->
+ reflections.getSubTypesOf(graphQLInterface).stream()
+ .filter(implementationQualifiesForInclusion)
+ .forEach(
+ implementation -> {
+ log.info(
+ "Registering {} as an implementation of GraphQL interface {}",
+ implementation,
+ graphQLInterface);
+ builder.additionalType(implementation);
+ }));
}
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsProperties.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsProperties.java
index 3de34e0e..6a37b3bb 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsProperties.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsProperties.java
@@ -16,36 +16,31 @@
@ConfigurationProperties(prefix = "graphql.annotations")
public class GraphQLAnnotationsProperties {
- /**
- * The base package where GraphQL definitions (resolvers, types etc.) are searched for.
- */
+ /** The base package where GraphQL definitions (resolvers, types etc.) are searched for. */
private @NotBlank String basePackage;
/**
* Set if fields should be globally prettified (removes get/set/is prefixes from names). Defaults
* to true.
*/
- @Builder.Default
- private boolean alwaysPrettify = true;
+ @Builder.Default private boolean alwaysPrettify = true;
/**
- * The prefix to use for input type names.
- * If not configured the default prefix of the GraphQL-Java Annotations library is used.
- * Configure an empty prefix for clearing the library's default prefix.
+ * The prefix to use for input type names. If not configured the default prefix of the
+ * GraphQL-Java Annotations library is used. Configure an empty prefix for clearing the library's
+ * default prefix.
*/
private String inputPrefix;
/**
- * The suffix to use for input type names.
- * If not configured the default suffix of the GraphQL-Java Annotations library is used.
+ * The suffix to use for input type names. If not configured the default suffix of the
+ * GraphQL-Java Annotations library is used.
*/
private String inputSuffix;
/**
- * If set to true abstract classes implementing a GraphQL interface will not be added to the schema.
- * Defaults to false for backward compatibility.
+ * If set to true abstract classes implementing a GraphQL interface will not be added
+ * to the schema. Defaults to false for backward compatibility.
*/
- @Builder.Default
- private boolean ignoreAbstractInterfaceImplementations = false;
-
+ @Builder.Default private boolean ignoreAbstractInterfaceImplementations = false;
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceTypeResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceTypeResolver.java
index b268170e..1aa6f1cb 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceTypeResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceTypeResolver.java
@@ -11,10 +11,9 @@
* Type resolver for GraphQL interfaces.
*
* @see Issue with
- * workaround.
- *
- * Apply this interface to GraphQL interfaces using the {@link graphql.annotations.annotationTypes.GraphQLTypeResolver}
- * annotation.
+ * workaround.
+ *
Apply this interface to GraphQL interfaces using the {@link
+ * graphql.annotations.annotationTypes.GraphQLTypeResolver} annotation.
*/
public class GraphQLInterfaceTypeResolver implements TypeResolver, ApplicationContextAware {
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLMutationResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLMutationResolver.java
index af58a171..c62e6e33 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLMutationResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLMutationResolver.java
@@ -7,7 +7,4 @@
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
-public @interface GraphQLMutationResolver {
-
-}
-
+public @interface GraphQLMutationResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLQueryResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLQueryResolver.java
index ab91cdc8..ae523344 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLQueryResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLQueryResolver.java
@@ -7,6 +7,4 @@
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
-public @interface GraphQLQueryResolver {
-
-}
+public @interface GraphQLQueryResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLScalarTypeFunction.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLScalarTypeFunction.java
index aa55a7d8..1191fe88 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLScalarTypeFunction.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLScalarTypeFunction.java
@@ -14,9 +14,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-/**
- * Maps Java classes to the corresponding scalar definitions.
- */
+/** Maps Java classes to the corresponding scalar definitions. */
@RequiredArgsConstructor
@Slf4j
public class GraphQLScalarTypeFunction implements TypeFunction {
@@ -33,8 +31,7 @@ public GraphQLType buildType(
final boolean input,
final Class> aClass,
final AnnotatedType annotatedType,
- final ProcessingElementsContainer container
- ) {
+ final ProcessingElementsContainer container) {
final GraphQLScalarType graphQLScalarType = getMatchingScalarDefinition(aClass).orElse(null);
if (nonNull(graphQLScalarType)) {
log.info("Registering scalar type {} for Java class {}", graphQLScalarType.getName(), aClass);
@@ -43,13 +40,17 @@ public GraphQLType buildType(
}
private Optional getMatchingScalarDefinition(final Class> aClass) {
- return customScalarTypes.stream().filter(scalarType -> {
- final Type[] genericInterfaces = scalarType.getCoercing().getClass().getGenericInterfaces();
- return genericInterfaces.length > 0
- && genericInterfaces[0] instanceof ParameterizedType
- && ((ParameterizedType) genericInterfaces[0]).getActualTypeArguments().length > 0
- && ((ParameterizedType) genericInterfaces[0]).getActualTypeArguments()[0].equals(aClass);
- }).findFirst();
+ return customScalarTypes.stream()
+ .filter(
+ scalarType -> {
+ final Type[] genericInterfaces =
+ scalarType.getCoercing().getClass().getGenericInterfaces();
+ return genericInterfaces.length > 0
+ && genericInterfaces[0] instanceof ParameterizedType
+ && ((ParameterizedType) genericInterfaces[0]).getActualTypeArguments().length > 0
+ && ((ParameterizedType) genericInterfaces[0])
+ .getActualTypeArguments()[0].equals(aClass);
+ })
+ .findFirst();
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLSubscriptionResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLSubscriptionResolver.java
index 83cc2919..581e2c3b 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLSubscriptionResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLSubscriptionResolver.java
@@ -7,6 +7,4 @@
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
-public @interface GraphQLSubscriptionResolver {
-
-}
+public @interface GraphQLSubscriptionResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsBeanTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsBeanTest.java
index 809f537e..bd36df68 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsBeanTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsBeanTest.java
@@ -14,8 +14,7 @@
@ActiveProfiles({"test", "query-test"})
class GraphQLAnnotationsBeanTest {
- @Autowired
- private ApplicationContext applicationContext;
+ @Autowired private ApplicationContext applicationContext;
@Test
@DisplayName("Should expose the GraphQL Annotations bean.")
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomAnnotationProcessorTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomAnnotationProcessorTest.java
index de98631a..a423a56e 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomAnnotationProcessorTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomAnnotationProcessorTest.java
@@ -15,8 +15,7 @@
@ActiveProfiles({"test", "custom-annotation-processor-test"})
class GraphQLAnnotationsCustomAnnotationProcessorTest {
- @SpyBean
- private CustomAnnotationProcessor customAnnotationProcessor;
+ @SpyBean private CustomAnnotationProcessor customAnnotationProcessor;
@Test
@DisplayName("Assert that the custom annotation processor is used.")
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomRelayTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomRelayTest.java
index e83464de..42990bb6 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomRelayTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomRelayTest.java
@@ -20,14 +20,11 @@
@ActiveProfiles({"test", "custom-relay-test"})
class GraphQLAnnotationsCustomRelayTest {
- @SpyBean
- private CustomRelay customRelay;
+ @SpyBean private CustomRelay customRelay;
- @Autowired
- private GraphQLSchema schema;
+ @Autowired private GraphQLSchema schema;
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("Assert that custom relay is used.")
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomScalarTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomScalarTest.java
index 75c52710..bcce243b 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomScalarTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomScalarTest.java
@@ -17,15 +17,14 @@
@ActiveProfiles({"test", "custom-scalar-test"})
class GraphQLAnnotationsCustomScalarTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("Assert that custom scalars work properly.")
void testQueryWithCustomScalar() throws IOException {
// WHEN
- final GraphQLResponse graphQLResponse
- = graphQLTestTemplate.postForResource("queries/test-custom-scalar-query.graphql");
+ final GraphQLResponse graphQLResponse =
+ graphQLTestTemplate.postForResource("queries/test-custom-scalar-query.graphql");
// THEN
assertThat(graphQLResponse.get("$.data.randomUUID", UUID.class)).isNotNull();
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomTypeFunctionTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomTypeFunctionTest.java
index 3593cbea..04562a8e 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomTypeFunctionTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsCustomTypeFunctionTest.java
@@ -16,15 +16,14 @@
@ActiveProfiles({"test", "custom-type-function-test"})
class GraphQLAnnotationsCustomTypeFunctionTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("Assert that custom type functions work properly.")
void testCustomTypeFunction() throws IOException {
// WHEN
- final GraphQLResponse actual
- = graphQLTestTemplate.postForResource("queries/test-custom-type-function.graphql");
+ final GraphQLResponse actual =
+ graphQLTestTemplate.postForResource("queries/test-custom-type-function.graphql");
// THEN
assertThat(actual.get("$.data.foo")).isEqualTo("foo");
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsDirectiveTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsDirectiveTest.java
index c605e4c9..de7f1e12 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsDirectiveTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsDirectiveTest.java
@@ -16,15 +16,14 @@
@ActiveProfiles({"test", "directive-test"})
class GraphQLAnnotationsDirectiveTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("Assert that directives are properly registered.")
void testDirectivesAreProperlyRegistered() throws IOException {
// WHEN
- final GraphQLResponse actual
- = graphQLTestTemplate.postForResource("queries/test-directive-query.graphql");
+ final GraphQLResponse actual =
+ graphQLTestTemplate.postForResource("queries/test-directive-query.graphql");
// THEN
assertThat(actual.get("$.data.queryWithDirective")).isEqualTo("THIS SHOULD BE UPPERCASE");
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMissingQueryResolverTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMissingQueryResolverTest.java
index 84ab7e74..79ac5997 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMissingQueryResolverTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMissingQueryResolverTest.java
@@ -12,7 +12,8 @@
class GraphQLAnnotationsErrorMissingQueryResolverTest {
@Test
- @DisplayName("Assert that MissingQueryResolverException is throw if no GraphQLQueryResolver classes are found.")
+ @DisplayName(
+ "Assert that MissingQueryResolverException is throw if no GraphQLQueryResolver classes are found.")
void testMissingQueryResolverExceptionIfNoQueryResolverProvided() {
// GIVEN
final SpringApplication app = new SpringApplication(TestApplication.class);
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleMutationResolversTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleMutationResolversTest.java
index 44fe9ff4..1f1d13e6 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleMutationResolversTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleMutationResolversTest.java
@@ -12,7 +12,8 @@
class GraphQLAnnotationsMultipleMutationResolversTest {
@Test
- @DisplayName("Assert that MultipleMutationResolversException is thrown when multiple mutation resolvers are found.")
+ @DisplayName(
+ "Assert that MultipleMutationResolversException is thrown when multiple mutation resolvers are found.")
void testMultipleMutationResolversExceptionIsThrown() {
// GIVEN
final SpringApplication app = new SpringApplication(TestApplication.class);
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleQueryResolversTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleQueryResolversTest.java
index 03772fa9..4aa7d73d 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleQueryResolversTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleQueryResolversTest.java
@@ -12,7 +12,8 @@
class GraphQLAnnotationsErrorMultipleQueryResolversTest {
@Test
- @DisplayName("Assert that MultipleQueryResolversException is thrown when multiple query resolvers are found.")
+ @DisplayName(
+ "Assert that MultipleQueryResolversException is thrown when multiple query resolvers are found.")
void testMultipleQueryResolversExceptionIsThrown() {
// GIVEN
final SpringApplication app = new SpringApplication(TestApplication.class);
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleSubscriptionResolversTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleSubscriptionResolversTest.java
index f82401f3..1210f978 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleSubscriptionResolversTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsErrorMultipleSubscriptionResolversTest.java
@@ -12,7 +12,8 @@
class GraphQLAnnotationsErrorMultipleSubscriptionResolversTest {
@Test
- @DisplayName("Assert that MultipleSubscriptionResolversException is thrown when multiple subscription resolvers are found.")
+ @DisplayName(
+ "Assert that MultipleSubscriptionResolversException is thrown when multiple subscription resolvers are found.")
void testMultipleSubscriptionResolversExceptionIsThrown() {
// GIVEN
final SpringApplication app = new SpringApplication(TestApplication.class);
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsExtendTypeTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsExtendTypeTest.java
index 98768203..c096ab95 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsExtendTypeTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsExtendTypeTest.java
@@ -16,15 +16,14 @@
@ActiveProfiles({"test", "extend-type-test"})
class GraphQLAnnotationsExtendTypeTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("Assert that extend types are properly registered.")
void testExtendTypesAreProperlyRegistered() throws IOException {
// WHEN
- final GraphQLResponse actual = graphQLTestTemplate
- .postForResource("queries/test-extend-type-query.graphql");
+ final GraphQLResponse actual =
+ graphQLTestTemplate.postForResource("queries/test-extend-type-query.graphql");
// THEN
assertThat(actual.get("$.data.someValue.baseTypeField")).isEqualTo("Test value");
assertThat(actual.get("$.data.someValue.extendTypeField")).isEqualTo("TEST VALUE");
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputPrefixTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputPrefixTest.java
index 0551ca94..e0ccdde8 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputPrefixTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputPrefixTest.java
@@ -1,5 +1,7 @@
package graphql.kickstart.graphql.annotations;
+import static org.assertj.core.api.Assertions.assertThat;
+
import graphql.schema.GraphQLSchema;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@@ -7,20 +9,14 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
-import static org.assertj.core.api.Assertions.assertThat;
-
@DisplayName("Testing input prefix")
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
- properties = {
- "graphql.annotations.input-prefix=Prefix",
- "graphql.annotations.input-suffix="
- }
-)
+@SpringBootTest(
+ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+ properties = {"graphql.annotations.input-prefix=Prefix", "graphql.annotations.input-suffix="})
@ActiveProfiles({"test", "mutation-test"})
class GraphQLAnnotationsMutationInputPrefixTest {
- @Autowired
- private GraphQLSchema graphQLSchema;
+ @Autowired private GraphQLSchema graphQLSchema;
@Test
@DisplayName("Assert that input prefix is used.")
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputSuffixTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputSuffixTest.java
index 104ba76e..ad27605d 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputSuffixTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationInputSuffixTest.java
@@ -1,5 +1,7 @@
package graphql.kickstart.graphql.annotations;
+import static org.assertj.core.api.Assertions.assertThat;
+
import graphql.schema.GraphQLSchema;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@@ -7,20 +9,14 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
-import static org.assertj.core.api.Assertions.assertThat;
-
@DisplayName("Testing input suffix")
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
- properties = {
- "graphql.annotations.input-prefix=",
- "graphql.annotations.input-suffix=Suffix"
- }
-)
+@SpringBootTest(
+ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+ properties = {"graphql.annotations.input-prefix=", "graphql.annotations.input-suffix=Suffix"})
@ActiveProfiles({"test", "mutation-test"})
class GraphQLAnnotationsMutationInputSuffixTest {
- @Autowired
- private GraphQLSchema graphQLSchema;
+ @Autowired private GraphQLSchema graphQLSchema;
@Test
@DisplayName("Assert that input suffix is used.")
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationTest.java
index ff7492af..65834c09 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsMutationTest.java
@@ -4,8 +4,8 @@
import com.graphql.spring.boot.test.GraphQLResponse;
import com.graphql.spring.boot.test.GraphQLTestTemplate;
-import java.io.IOException;
import graphql.schema.GraphQLSchema;
+import java.io.IOException;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -17,18 +17,16 @@
@ActiveProfiles({"test", "mutation-test"})
class GraphQLAnnotationsMutationTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
- @Autowired
- private GraphQLSchema graphQLSchema;
+ @Autowired private GraphQLSchema graphQLSchema;
@Test
@DisplayName("Assert that mutation resolver is properly registered.")
void testMutationResolver() throws IOException {
// WHEN
- final GraphQLResponse actual = graphQLTestTemplate
- .postForResource("mutations/test-mutation.graphql");
+ final GraphQLResponse actual =
+ graphQLTestTemplate.postForResource("mutations/test-mutation.graphql");
// THEN
assertThat(actual.get("$.data.performSomeOperation.testField")).isEqualTo("Test value");
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDefaultTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDefaultTest.java
index 4494b6c2..32f0dac9 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDefaultTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDefaultTest.java
@@ -16,15 +16,14 @@
@ActiveProfiles({"test", "prettify-default-test"})
class GraphQLAnnotationsPrettifyDefaultTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("By default, it should always prettify fields.")
void testDefaultPrettifySettings() throws IOException {
// WHEN
- final GraphQLResponse graphQLResponse
- = graphQLTestTemplate.postForResource("queries/test-prettified-query.graphql");
+ final GraphQLResponse graphQLResponse =
+ graphQLTestTemplate.postForResource("queries/test-prettified-query.graphql");
// THEN
assertThat(graphQLResponse.get("$.data.someValue")).isEqualTo("some value");
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDisabledTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDisabledTest.java
index 1695c179..960a4353 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDisabledTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyDisabledTest.java
@@ -16,15 +16,14 @@
@ActiveProfiles({"test", "prettify-disabled-test"})
class GraphQLAnnotationsPrettifyDisabledTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("If disabled, fields should not be prettified.")
void testDefaultPrettifySettings() throws IOException {
// WHEN
- final GraphQLResponse graphQLResponse
- = graphQLTestTemplate.postForResource("queries/test-not-prettified-query.graphql");
+ final GraphQLResponse graphQLResponse =
+ graphQLTestTemplate.postForResource("queries/test-not-prettified-query.graphql");
// THEN
assertThat(graphQLResponse.get("$.data.getSomeValue")).isEqualTo("some value");
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyEnabledTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyEnabledTest.java
index 6e5765e5..50f244fb 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyEnabledTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsPrettifyEnabledTest.java
@@ -16,15 +16,14 @@
@ActiveProfiles({"test", "prettify-enabled-test"})
class GraphQLAnnotationsPrettifyEnabledTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
@Test
@DisplayName("If enabled, it should always prettify fields.")
void testDefaultPrettifySettings() throws IOException {
// WHEN
- final GraphQLResponse graphQLResponse
- = graphQLTestTemplate.postForResource("queries/test-prettified-query.graphql");
+ final GraphQLResponse graphQLResponse =
+ graphQLTestTemplate.postForResource("queries/test-prettified-query.graphql");
// THEN
assertThat(graphQLResponse.get("$.data.someValue")).isEqualTo("some value");
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsQueryTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsQueryTest.java
index a78c7725..e61022fb 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsQueryTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsQueryTest.java
@@ -15,14 +15,14 @@
@DisplayName("Testing query resolver registration.")
@ActiveProfiles({"test", "query-test"})
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = TestApplication.class)
+@SpringBootTest(
+ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+ classes = TestApplication.class)
class GraphQLAnnotationsQueryTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
- @Autowired
- private ObjectMapper objectMapper;
+ @Autowired private ObjectMapper objectMapper;
@Test
@DisplayName("Assert that query resolver is properly detected.")
@@ -31,8 +31,8 @@ void testHelloQuery() throws IOException {
final ObjectNode params = objectMapper.createObjectNode();
params.put("who", "John");
// WHEN
- final GraphQLResponse graphQLResponse = graphQLTestTemplate
- .perform("queries/hello.graphql", params);
+ final GraphQLResponse graphQLResponse =
+ graphQLTestTemplate.perform("queries/hello.graphql", params);
// THEN
assertThat(graphQLResponse.get("$.data.hello")).isEqualTo("Hello, John!");
assertThat(graphQLResponse.get("$.data.helloWorld")).isEqualTo("Hello, World!");
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsSubscriptionTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsSubscriptionTest.java
index 3801561e..3d873f3c 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsSubscriptionTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsSubscriptionTest.java
@@ -15,16 +15,17 @@
@ActiveProfiles({"test", "subscription-test"})
class GraphQLAnnotationsSubscriptionTest {
- @Autowired
- private GraphQLTestSubscription graphQLTestSubscription;
+ @Autowired private GraphQLTestSubscription graphQLTestSubscription;
@Test
@DisplayName("Assert that subscription resolver is properly registered.")
void testSubscription() {
// GIVEN
- final GraphQLResponse graphQLResponse = graphQLTestSubscription.init()
- .start("subscriptions/test-subscription.graphql")
- .awaitAndGetNextResponse(10000);
+ final GraphQLResponse graphQLResponse =
+ graphQLTestSubscription
+ .init()
+ .start("subscriptions/test-subscription.graphql")
+ .awaitAndGetNextResponse(10000);
// THEN
assertThat(graphQLResponse.get("$.data.testSubscription")).isEqualTo("some value");
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryIgnoreAbstractInterfaceImplementationsTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryIgnoreAbstractInterfaceImplementationsTest.java
index 2c24b6bf..438f66f5 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryIgnoreAbstractInterfaceImplementationsTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryIgnoreAbstractInterfaceImplementationsTest.java
@@ -1,5 +1,7 @@
package graphql.kickstart.graphql.annotations;
+import static org.assertj.core.api.Assertions.assertThat;
+
import com.graphql.spring.boot.test.GraphQLResponse;
import com.graphql.spring.boot.test.GraphQLTestTemplate;
import graphql.kickstart.graphql.annotations.test.interfaces.Car;
@@ -7,58 +9,57 @@
import graphql.schema.GraphQLNamedType;
import graphql.schema.GraphQLScalarType;
import graphql.schema.GraphQLSchema;
+import java.io.IOException;
+import java.util.Set;
+import java.util.stream.Collectors;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
-import java.io.IOException;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
@DisplayName("Testing interface handling (ignore abstract implementations).")
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
- properties = "graphql.annotations.ignore-abstract-interface-implementations=true")
+@SpringBootTest(
+ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+ properties = "graphql.annotations.ignore-abstract-interface-implementations=true")
@ActiveProfiles({"test", "interface-test"})
class GraphQLInterfaceQueryIgnoreAbstractInterfaceImplementationsTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
- @Autowired
- private GraphQLSchema graphQLSchema;
+ @Autowired private GraphQLSchema graphQLSchema;
@Test
@DisplayName("Assert that GraphQL interfaces and their implementations are registered correctly.")
void testInterfaceQuery() throws IOException {
// WHEN
- final GraphQLResponse actual = graphQLTestTemplate
- .postForResource("queries/test-interface-query.graphql");
+ final GraphQLResponse actual =
+ graphQLTestTemplate.postForResource("queries/test-interface-query.graphql");
// THEN
assertThat(actual.get("$.data.vehicles[0]", Car.class))
- .usingRecursiveComparison().ignoringAllOverriddenEquals()
+ .usingRecursiveComparison()
+ .ignoringAllOverriddenEquals()
.isEqualTo(Car.builder().numberOfSeats(4).registrationNumber("ABC-123").build());
assertThat(actual.get("$.data.vehicles[1]", Truck.class))
- .usingRecursiveComparison().ignoringAllOverriddenEquals()
+ .usingRecursiveComparison()
+ .ignoringAllOverriddenEquals()
.isEqualTo(Truck.builder().cargoWeightCapacity(12).registrationNumber("CBA-321").build());
}
@Test
- @DisplayName("Assert that abstract GraphQL interface implementations are excluded from the schema.")
+ @DisplayName(
+ "Assert that abstract GraphQL interface implementations are excluded from the schema.")
void testInterfaceImplementationDetection() {
// THEN
- Set vehicleDomainTypes = graphQLSchema.getAllTypesAsList().stream()
- .filter(type -> !(type instanceof GraphQLScalarType))
- .map(GraphQLNamedType::getName)
- .filter(name -> !name.startsWith("__"))
- .filter(name -> !"PageInfo".equals(name))
- .collect(Collectors.toSet());
+ Set vehicleDomainTypes =
+ graphQLSchema.getAllTypesAsList().stream()
+ .filter(type -> !(type instanceof GraphQLScalarType))
+ .map(GraphQLNamedType::getName)
+ .filter(name -> !name.startsWith("__"))
+ .filter(name -> !"PageInfo".equals(name))
+ .collect(Collectors.toSet());
// Must not contain "AbstractVehicle"
assertThat(vehicleDomainTypes)
.containsExactlyInAnyOrder("InterfaceQuery", "Vehicle", "Car", "Truck");
}
}
-
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryTest.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryTest.java
index 9ed3039b..d9c50cde 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/GraphQLInterfaceQueryTest.java
@@ -6,12 +6,12 @@
import com.graphql.spring.boot.test.GraphQLTestTemplate;
import graphql.kickstart.graphql.annotations.test.interfaces.Car;
import graphql.kickstart.graphql.annotations.test.interfaces.Truck;
-import java.io.IOException;
-import java.util.Set;
-import java.util.stream.Collectors;
import graphql.schema.GraphQLNamedType;
import graphql.schema.GraphQLScalarType;
import graphql.schema.GraphQLSchema;
+import java.io.IOException;
+import java.util.Set;
+import java.util.stream.Collectors;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -23,24 +23,24 @@
@ActiveProfiles({"test", "interface-test"})
class GraphQLInterfaceQueryTest {
- @Autowired
- private GraphQLTestTemplate graphQLTestTemplate;
+ @Autowired private GraphQLTestTemplate graphQLTestTemplate;
- @Autowired
- private GraphQLSchema graphQLSchema;
+ @Autowired private GraphQLSchema graphQLSchema;
@Test
@DisplayName("Assert that GraphQL interfaces and their implementations are registered correctly.")
void testInterfaceQuery() throws IOException {
// WHEN
- final GraphQLResponse actual = graphQLTestTemplate
- .postForResource("queries/test-interface-query.graphql");
+ final GraphQLResponse actual =
+ graphQLTestTemplate.postForResource("queries/test-interface-query.graphql");
// THEN
assertThat(actual.get("$.data.vehicles[0]", Car.class))
- .usingRecursiveComparison().ignoringAllOverriddenEquals()
+ .usingRecursiveComparison()
+ .ignoringAllOverriddenEquals()
.isEqualTo(Car.builder().numberOfSeats(4).registrationNumber("ABC-123").build());
assertThat(actual.get("$.data.vehicles[1]", Truck.class))
- .usingRecursiveComparison().ignoringAllOverriddenEquals()
+ .usingRecursiveComparison()
+ .ignoringAllOverriddenEquals()
.isEqualTo(Truck.builder().cargoWeightCapacity(12).registrationNumber("CBA-321").build());
}
@@ -48,15 +48,15 @@ void testInterfaceQuery() throws IOException {
@DisplayName("Assert that abstract GraphQL interface implementations are added to the schema.")
void testInterfaceImplementationDetection() {
// THEN
- Set vehicleDomainTypes = graphQLSchema.getAllTypesAsList().stream()
- .filter(type -> !(type instanceof GraphQLScalarType))
- .map(GraphQLNamedType::getName)
- .filter(name -> !name.startsWith("__"))
- .filter(name -> !"PageInfo".equals(name))
- .collect(Collectors.toSet());
+ Set vehicleDomainTypes =
+ graphQLSchema.getAllTypesAsList().stream()
+ .filter(type -> !(type instanceof GraphQLScalarType))
+ .map(GraphQLNamedType::getName)
+ .filter(name -> !name.startsWith("__"))
+ .filter(name -> !"PageInfo".equals(name))
+ .collect(Collectors.toSet());
// Should contain "AbstractVehicle"
assertThat(vehicleDomainTypes)
.containsExactlyInAnyOrder("InterfaceQuery", "Vehicle", "AbstractVehicle", "Car", "Truck");
}
}
-
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/TestApplication.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/TestApplication.java
index 5e419a4b..21b0880c 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/TestApplication.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/TestApplication.java
@@ -9,5 +9,4 @@ public class TestApplication {
public static void main(final String[] args) {
SpringApplication.run(TestApplication.class, args);
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/annotation/processor/CustomAnnotationProcessor.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/annotation/processor/CustomAnnotationProcessor.java
index 5c43a70e..fd5bfb4d 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/annotation/processor/CustomAnnotationProcessor.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/annotation/processor/CustomAnnotationProcessor.java
@@ -11,10 +11,10 @@
@Service
public class CustomAnnotationProcessor extends GraphQLAnnotations {
- public CustomAnnotationProcessor() {
- }
+ public CustomAnnotationProcessor() {}
- public CustomAnnotationProcessor(TypeFunction defaultTypeFunction,
+ public CustomAnnotationProcessor(
+ TypeFunction defaultTypeFunction,
GraphQLObjectHandler graphQLObjectHandler,
GraphQLExtensionsHandler graphQLExtensionsHandler) {
super(defaultTypeFunction, graphQLObjectHandler, graphQLExtensionsHandler);
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/CustomRelay.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/CustomRelay.java
index babc2db8..aa0d0308 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/CustomRelay.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/CustomRelay.java
@@ -6,6 +6,4 @@
@Service
@Profile("custom-relay-test")
-public class CustomRelay extends Relay {
-
-}
+public class CustomRelay extends Relay {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestModel.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestModel.java
index b3b5d63a..87f81df0 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestModel.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestModel.java
@@ -6,6 +6,5 @@
@Value
public class TestModel {
- @GraphQLField
- String someField;
+ @GraphQLField String someField;
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestQuery.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestQuery.java
index 4f2918f9..76064647 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestQuery.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/relay/TestQuery.java
@@ -13,8 +13,8 @@ public class TestQuery {
@GraphQLField
@GraphQLConnection
public static PaginatedData somePaginatedValue() {
- return new AbstractPaginatedData(false, false,
- Collections.singletonList(new TestModel("some value"))) {
+ return new AbstractPaginatedData(
+ false, false, Collections.singletonList(new TestModel("some value"))) {
@Override
public String getCursor(final TestModel entity) {
return "test cursor";
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/Foo.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/Foo.java
index c976df7f..aa1ad29c 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/Foo.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/Foo.java
@@ -1,5 +1,3 @@
package graphql.kickstart.graphql.annotations.test.custom.type.function;
-public class Foo {
-
-}
+public class Foo {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/FooTypeFunction.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/FooTypeFunction.java
index 36e63fbb..01e1af2c 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/FooTypeFunction.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/custom/type/function/FooTypeFunction.java
@@ -23,30 +23,31 @@ public boolean canBuildType(final Class> aClass, final AnnotatedType annotated
}
@Override
- public GraphQLType buildType(boolean input,
+ public GraphQLType buildType(
+ boolean input,
final Class> aClass,
final AnnotatedType annotatedType,
- final ProcessingElementsContainer container
- ) {
+ final ProcessingElementsContainer container) {
return newScalar()
.name("Foo")
- .coercing(new Coercing() {
- @Override
- public String serialize(final Object dataFetcherResult)
- throws CoercingSerializeException {
- return "foo";
- }
+ .coercing(
+ new Coercing() {
+ @Override
+ public String serialize(final Object dataFetcherResult)
+ throws CoercingSerializeException {
+ return "foo";
+ }
- @Override
- public Foo parseValue(final Object input) throws CoercingParseValueException {
- return new Foo();
- }
+ @Override
+ public Foo parseValue(final Object input) throws CoercingParseValueException {
+ return new Foo();
+ }
- @Override
- public Foo parseLiteral(final Object input) throws CoercingParseLiteralException {
- return new Foo();
- }
- })
+ @Override
+ public Foo parseLiteral(final Object input) throws CoercingParseLiteralException {
+ return new Foo();
+ }
+ })
.build();
}
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirective.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirective.java
index d79a4a76..9e1d9906 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirective.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirective.java
@@ -13,6 +13,4 @@
@GraphQLDirectiveDefinition(wiring = UpperCaseDirectiveWiring.class)
@DirectiveLocations({Introspection.DirectiveLocation.FIELD_DEFINITION})
@Retention(RetentionPolicy.RUNTIME)
-public @interface UpperCaseDirective {
-
-}
+public @interface UpperCaseDirective {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirectiveWiring.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirectiveWiring.java
index 7a17aaf8..51ed5dca 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirectiveWiring.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/directive/UpperCaseDirectiveWiring.java
@@ -12,12 +12,15 @@ public class UpperCaseDirectiveWiring implements AnnotationsDirectiveWiring {
@Override
public GraphQLFieldDefinition onField(final AnnotationsWiringEnvironment environment) {
final GraphQLFieldDefinition field = (GraphQLFieldDefinition) environment.getElement();
- CodeRegistryUtil.wrapDataFetcher(field, environment, (((dataFetchingEnvironment, value) -> {
- if (value instanceof String) {
- return ((String) value).toUpperCase();
- }
- return value;
- })));
+ CodeRegistryUtil.wrapDataFetcher(
+ field,
+ environment,
+ (((dataFetchingEnvironment, value) -> {
+ if (value instanceof String) {
+ return ((String) value).toUpperCase();
+ }
+ return value;
+ })));
return field;
}
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/FirstMutationResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/FirstMutationResolver.java
index b439093f..660855da 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/FirstMutationResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/FirstMutationResolver.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLMutationResolver;
@GraphQLMutationResolver
-public class FirstMutationResolver {
-
-}
+public class FirstMutationResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/SecondMutationResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/SecondMutationResolver.java
index 3681dc56..4d28e83f 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/SecondMutationResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/SecondMutationResolver.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLMutationResolver;
@GraphQLMutationResolver
-public class SecondMutationResolver {
-
-}
+public class SecondMutationResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/TestQuery.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/TestQuery.java
index a0c595b2..a1d96e34 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/TestQuery.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/mutation/TestQuery.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLQueryResolver;
@GraphQLQueryResolver
-public class TestQuery {
-
-}
+public class TestQuery {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/FirstQueryResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/FirstQueryResolver.java
index 2825537a..5baecfe8 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/FirstQueryResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/FirstQueryResolver.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLQueryResolver;
@GraphQLQueryResolver
-public class FirstQueryResolver {
-
-}
+public class FirstQueryResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/SecondQueryResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/SecondQueryResolver.java
index dd1ca894..803fc543 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/SecondQueryResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/query/SecondQueryResolver.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLQueryResolver;
@GraphQLQueryResolver
-public class SecondQueryResolver {
-
-}
+public class SecondQueryResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/FirstSubscriptionResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/FirstSubscriptionResolver.java
index ff734308..a72d6934 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/FirstSubscriptionResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/FirstSubscriptionResolver.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLSubscriptionResolver;
@GraphQLSubscriptionResolver
-public class FirstSubscriptionResolver {
-
-}
+public class FirstSubscriptionResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/SecondSubscriptionResolver.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/SecondSubscriptionResolver.java
index a950dc3d..2c8431c5 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/SecondSubscriptionResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/SecondSubscriptionResolver.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLSubscriptionResolver;
@GraphQLSubscriptionResolver
-public class SecondSubscriptionResolver {
-
-}
+public class SecondSubscriptionResolver {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/TestQuery.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/TestQuery.java
index 76df4012..ef9c74ed 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/TestQuery.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/error/multiple/subscription/TestQuery.java
@@ -3,6 +3,4 @@
import graphql.kickstart.graphql.annotations.GraphQLQueryResolver;
@GraphQLQueryResolver
-public class TestQuery {
-
-}
+public class TestQuery {}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/extend/type/model/BaseType.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/extend/type/model/BaseType.java
index 1f2efd61..af43b677 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/extend/type/model/BaseType.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/extend/type/model/BaseType.java
@@ -8,6 +8,5 @@
@AllArgsConstructor
public class BaseType {
- @GraphQLField
- private String baseTypeField;
+ @GraphQLField private String baseTypeField;
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/AbstractVehicle.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/AbstractVehicle.java
index dad3a501..2bb35814 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/AbstractVehicle.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/AbstractVehicle.java
@@ -13,10 +13,6 @@
@NoArgsConstructor
public abstract class AbstractVehicle implements Vehicle {
- /**
- * Note that you have to repeat the annotations from the interface method!
- */
- @GraphQLField
- @GraphQLNonNull
- private String registrationNumber;
+ /** Note that you have to repeat the annotations from the interface method! */
+ @GraphQLField @GraphQLNonNull private String registrationNumber;
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Car.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Car.java
index 5c836a5c..7b283d99 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Car.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Car.java
@@ -17,9 +17,7 @@
// because otherwise GraphQL-Java Annotations would not find this class.
public class Car extends AbstractVehicle implements Vehicle {
- @GraphQLField
- @GraphQLNonNull
- private int numberOfSeats;
+ @GraphQLField @GraphQLNonNull private int numberOfSeats;
public Car(String registrationNumber, int numberOfSeats) {
super(registrationNumber);
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Truck.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Truck.java
index f1f7fbf8..72d5de32 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Truck.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/interfaces/Truck.java
@@ -15,14 +15,8 @@
// hierarchy free from abstract classes.
public class Truck implements Vehicle {
- /**
- * Note that you have to repeat the annotations from the interface method!
- */
- @GraphQLField
- @GraphQLNonNull
- private String registrationNumber;
+ /** Note that you have to repeat the annotations from the interface method! */
+ @GraphQLField @GraphQLNonNull private String registrationNumber;
- @GraphQLField
- @GraphQLNonNull
- private int cargoWeightCapacity;
+ @GraphQLField @GraphQLNonNull private int cargoWeightCapacity;
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/mutation/model/TestModel.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/mutation/model/TestModel.java
index 4f100ab9..cc8ea8aa 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/mutation/model/TestModel.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/mutation/model/TestModel.java
@@ -12,6 +12,5 @@
@NoArgsConstructor
public class TestModel {
- @GraphQLField
- private String testField;
+ @GraphQLField private String testField;
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/scalar/CustomScalarConfig.java b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/scalar/CustomScalarConfig.java
index 384d5ecc..206e22c3 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/scalar/CustomScalarConfig.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/test/java/graphql/kickstart/graphql/annotations/test/scalar/CustomScalarConfig.java
@@ -24,30 +24,31 @@ public GraphQLScalarType uuidScalar() {
return newScalar()
.name("UUID")
.description("Standard UUID")
- .coercing(new Coercing() {
- @Override
- public String serialize(Object dataFetcherResult) throws CoercingSerializeException {
- return String.valueOf(dataFetcherResult);
- }
+ .coercing(
+ new Coercing() {
+ @Override
+ public String serialize(Object dataFetcherResult) throws CoercingSerializeException {
+ return String.valueOf(dataFetcherResult);
+ }
- @Override
- public UUID parseValue(Object input) throws CoercingParseValueException {
- try {
- return UUID.fromString(String.valueOf(input));
- } catch (IllegalArgumentException e) {
- throw new CoercingParseValueException(e);
- }
- }
+ @Override
+ public UUID parseValue(Object input) throws CoercingParseValueException {
+ try {
+ return UUID.fromString(String.valueOf(input));
+ } catch (IllegalArgumentException e) {
+ throw new CoercingParseValueException(e);
+ }
+ }
- @Override
- public UUID parseLiteral(Object input) throws CoercingParseLiteralException {
- try {
- return UUID.fromString(((StringValue) input).getValue());
- } catch (IllegalArgumentException e) {
- throw new CoercingParseLiteralException(e);
- }
- }
- })
+ @Override
+ public UUID parseLiteral(Object input) throws CoercingParseLiteralException {
+ try {
+ return UUID.fromString(((StringValue) input).getValue());
+ } catch (IllegalArgumentException e) {
+ throw new CoercingParseLiteralException(e);
+ }
+ }
+ })
.build();
}
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProvider.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProvider.java
index 9d1bcf54..a1b27a51 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProvider.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProvider.java
@@ -16,8 +16,7 @@
public class ClasspathResourceSchemaStringProvider implements SchemaStringProvider {
- @Autowired
- private ApplicationContext applicationContext;
+ @Autowired private ApplicationContext applicationContext;
private String schemaLocationPattern;
public ClasspathResourceSchemaStringProvider(String schemaLocationPattern) {
@@ -34,22 +33,17 @@ public List schemaStrings() throws IOException {
+ "'. Please add a graphql schema to the classpath or add a SchemaParser bean to your application context.");
}
- return Arrays.stream(resources)
- .map(this::readSchema)
- .collect(Collectors.toList());
+ return Arrays.stream(resources).map(this::readSchema).collect(Collectors.toList());
}
private String readSchema(Resource resource) {
- try (
- InputStream inputStream = resource.getInputStream();
- InputStreamReader bufferedInputStream = new InputStreamReader(inputStream,
- StandardCharsets.UTF_8.name());
- BufferedReader reader = new BufferedReader(bufferedInputStream)
- ) {
+ try (InputStream inputStream = resource.getInputStream();
+ InputStreamReader bufferedInputStream =
+ new InputStreamReader(inputStream, StandardCharsets.UTF_8.name());
+ BufferedReader reader = new BufferedReader(bufferedInputStream)) {
return reader.lines().collect(joining("\n"));
} catch (IOException e) {
throw new IllegalStateException("Cannot read graphql schema from resource " + resource, e);
}
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.java
index 43eb34f6..1367e978 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.java
@@ -38,9 +38,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
@Slf4j
@Configuration
@ConditionalOnClass(SchemaParser.class)
@@ -64,8 +62,7 @@ public SchemaParserOptions.Builder optionsBuilder(
@Autowired(required = false) List proxyHandlers,
@Autowired(required = false) CoroutineContextProvider coroutineContextProvider,
@Autowired(required = false) List typeDefinitionFactories,
- @Autowired(required = false) GraphqlFieldVisibility fieldVisibility
- ) {
+ @Autowired(required = false) GraphqlFieldVisibility fieldVisibility) {
SchemaParserOptions.Builder optionsBuilder = SchemaParserOptions.newOptions();
if (perFieldObjectMapperProvider != null) {
@@ -102,8 +99,8 @@ public SchemaParser schemaParser(
@Autowired(required = false) SchemaParserDictionary dictionary,
@Autowired(required = false) GraphQLScalarType[] scalars,
@Autowired(required = false) List directives,
- @Autowired(required = false) List directiveWirings
- ) throws IOException {
+ @Autowired(required = false) List directiveWirings)
+ throws IOException {
SchemaParserBuilder builder = new SchemaParserBuilder();
if (nonNull(dictionary)) {
builder.dictionary(dictionary.getDictionary());
@@ -125,18 +122,17 @@ public SchemaParser schemaParser(
directiveWirings.forEach(builder::directiveWiring);
}
- return builder
- .resolvers(resolvers)
- .build();
+ return builder.resolvers(resolvers).build();
}
@Bean
@ConditionalOnMissingBean
- @ConditionalOnProperty(value = "graphql.tools.use-default-objectmapper", havingValue = "true", matchIfMissing = true)
+ @ConditionalOnProperty(
+ value = "graphql.tools.use-default-objectmapper",
+ havingValue = "true",
+ matchIfMissing = true)
public PerFieldObjectMapperProvider perFieldObjectMapperProvider(ObjectMapper objectMapper) {
- objectMapper
- .registerModule(new Jdk8Module())
- .registerModule(new KotlinModule());
+ objectMapper.registerModule(new Jdk8Module()).registerModule(new KotlinModule());
return fieldDefinition -> objectMapper;
}
@@ -150,8 +146,9 @@ public GraphQLSchema graphQLSchema(SchemaParser schemaParser) {
@Bean
@ConditionalOnProperty(value = "graphql.tools.introspection-enabled", havingValue = "false")
GraphqlFieldVisibility disableIntrospection() {
- log.warn("GraphQL introspection query disabled! This puts your server in contravention of the "
- + "GraphQL specification and expectations of most clients, so use this option with caution");
+ log.warn(
+ "GraphQL introspection query disabled! This puts your server in contravention of the "
+ + "GraphQL specification and expectations of most clients, so use this option with caution");
return new NoIntrospectionGraphqlFieldVisibility();
}
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLToolsProperties.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLToolsProperties.java
index d47ee0c4..f61b6ade 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLToolsProperties.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLToolsProperties.java
@@ -13,6 +13,6 @@ class GraphQLToolsProperties {
* the GraphQL specification and expectations of most clients, so use this option with caution
*/
private boolean introspectionEnabled = true;
- private boolean useDefaultObjectmapper = true;
+ private boolean useDefaultObjectmapper = true;
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaDirective.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaDirective.java
index 914a591e..ee3ead34 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaDirective.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaDirective.java
@@ -19,5 +19,4 @@ public String getName() {
public SchemaDirectiveWiring getDirective() {
return directive;
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaStringProvider.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaStringProvider.java
index f609a4c7..2d1b16ef 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaStringProvider.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/SchemaStringProvider.java
@@ -6,5 +6,4 @@
public interface SchemaStringProvider {
List schemaStrings() throws IOException;
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/AbstractAutoConfigurationTest.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/AbstractAutoConfigurationTest.java
index f26281ef..5c8ec70e 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/AbstractAutoConfigurationTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/AbstractAutoConfigurationTest.java
@@ -13,9 +13,7 @@
import org.springframework.mock.web.MockServletContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
public abstract class AbstractAutoConfigurationTest {
private final Class extends AbstractApplicationContext> contextClass;
@@ -27,8 +25,8 @@ protected AbstractAutoConfigurationTest(Class> autoConfiguration) {
this(AnnotationConfigApplicationContext.class, autoConfiguration);
}
- protected AbstractAutoConfigurationTest(Class extends AbstractApplicationContext> contextClass,
- Class> autoConfiguration) {
+ protected AbstractAutoConfigurationTest(
+ Class extends AbstractApplicationContext> contextClass, Class> autoConfiguration) {
assert AnnotationConfigRegistry.class.isAssignableFrom(contextClass);
this.contextClass = contextClass;
this.autoConfiguration = autoConfiguration;
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProviderTest.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProviderTest.java
index 5edd9a32..6b7043a4 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProviderTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/ClasspathResourceSchemaStringProviderTest.java
@@ -29,8 +29,8 @@ public void clear() {
@Test
void schemaStrings() throws IOException {
load(BaseConfiguration.class);
- ClasspathResourceSchemaStringProvider schemaStringProvider = getContext()
- .getBean(ClasspathResourceSchemaStringProvider.class);
+ ClasspathResourceSchemaStringProvider schemaStringProvider =
+ getContext().getBean(ClasspathResourceSchemaStringProvider.class);
List schemaStrings = schemaStringProvider.schemaStrings();
assertThat(schemaStrings).hasSize(1);
@@ -46,6 +46,5 @@ String schemaLocationTest(String id) {
return id;
}
}
-
}
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfigurationTest.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfigurationTest.java
index 4bd8afa7..c24d1126 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfigurationTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfigurationTest.java
@@ -9,9 +9,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-/**
- * @author oEmbedler Inc.
- */
+/** @author oEmbedler Inc. */
class GraphQLJavaToolsAutoConfigurationTest extends AbstractAutoConfigurationTest {
public GraphQLJavaToolsAutoConfigurationTest() {
@@ -47,15 +45,16 @@ static class InterfaceConfiguration {
@Bean
public SchemaStringProvider schemaStringProvider() {
ListSchemaStringProvider schemaStringProvider = new ListSchemaStringProvider();
- schemaStringProvider.add("type Query {"
- + " theInterface:Interface!"
- + "} "
- + "interface Interface {"
- + " method:String!"
- + "}"
- + "type Implementation implements Interface {"
- + " method:String!"
- + "}");
+ schemaStringProvider.add(
+ "type Query {"
+ + " theInterface:Interface!"
+ + "} "
+ + "interface Interface {"
+ + " method:String!"
+ + "}"
+ + "type Implementation implements Interface {"
+ + " method:String!"
+ + "}");
return schemaStringProvider;
}
@@ -92,6 +91,4 @@ public String method() {
}
}
}
-
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLToolsDirectiveTest.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLToolsDirectiveTest.java
index 3af35cd6..b5e7b3e5 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLToolsDirectiveTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/GraphQLToolsDirectiveTest.java
@@ -26,8 +26,8 @@ public void clear() {
@Test
void directiveIsLoaded() {
- System.setProperty("graphql.tools.schemaLocationPattern",
- "graphql/schema-directive-test.graphql");
+ System.setProperty(
+ "graphql.tools.schemaLocationPattern", "graphql/schema-directive-test.graphql");
load(BaseConfiguration.class);
assertThat(this.getContext().getBean(GraphQLSchema.class)).isNotNull();
}
@@ -37,13 +37,15 @@ static class BaseConfiguration {
@Bean
public SchemaDirective uppercaseDirective() {
- return new SchemaDirective("uppercase", new SchemaDirectiveWiring() {
- @Override
- public GraphQLObjectType onObject(
- SchemaDirectiveWiringEnvironment environment) {
- return null;
- }
- });
+ return new SchemaDirective(
+ "uppercase",
+ new SchemaDirectiveWiring() {
+ @Override
+ public GraphQLObjectType onObject(
+ SchemaDirectiveWiringEnvironment environment) {
+ return null;
+ }
+ });
}
@Component
diff --git a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/Query.java b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/Query.java
index 0038a9d1..39292148 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/Query.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-tools/src/test/java/graphql/kickstart/tools/boot/Query.java
@@ -3,9 +3,7 @@
import graphql.kickstart.tools.GraphQLQueryResolver;
import org.springframework.stereotype.Component;
-/**
- * @author Andrew Potter
- */
+/** @author Andrew Potter */
@Component
public class Query implements GraphQLQueryResolver {
diff --git a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/GraphQLSpringWebfluxAutoConfiguration.java b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/GraphQLSpringWebfluxAutoConfiguration.java
index f1e71c11..592f341b 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/GraphQLSpringWebfluxAutoConfiguration.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/GraphQLSpringWebfluxAutoConfiguration.java
@@ -72,8 +72,8 @@ public GraphQLErrorStartupListener graphQLErrorStartupListener(
@Bean
@ConditionalOnMissingBean
- public GraphQLObjectMapper graphQLObjectMapper(ObjectProvider provider,
- ErrorHandlerSupplier errorHandlerSupplier) {
+ public GraphQLObjectMapper graphQLObjectMapper(
+ ObjectProvider provider, ErrorHandlerSupplier errorHandlerSupplier) {
GraphQLObjectMapper.Builder builder = newBuilder();
builder.withGraphQLErrorHandler(errorHandlerSupplier);
provider.ifAvailable(builder::withObjectMapperProvider);
@@ -103,10 +103,9 @@ public GraphQLSchemaProvider graphQLSchemaProvider(GraphQLSchema schema) {
public GraphQLSpringWebfluxInvocationInputFactory graphQLSpringInvocationInputFactory(
GraphQLSchemaProvider graphQLSchemaProvider,
@Autowired(required = false) GraphQLSpringWebfluxContextBuilder contextBuilder,
- @Autowired(required = false) GraphQLSpringWebfluxRootObjectBuilder rootObjectBuilder
- ) {
- return new GraphQLSpringWebfluxInvocationInputFactory(graphQLSchemaProvider, contextBuilder,
- rootObjectBuilder);
+ @Autowired(required = false) GraphQLSpringWebfluxRootObjectBuilder rootObjectBuilder) {
+ return new GraphQLSpringWebfluxInvocationInputFactory(
+ graphQLSchemaProvider, contextBuilder, rootObjectBuilder);
}
@Bean
@@ -118,14 +117,15 @@ public GraphQLBuilder graphQLBuilder() {
@Bean
@ConditionalOnMissingBean
public BatchedDataLoaderGraphQLBuilder batchedDataLoaderGraphQLBuilder(
- @Autowired(required = false) Supplier optionsSupplier
- ) {
+ @Autowired(required = false)
+ Supplier optionsSupplier) {
return new BatchedDataLoaderGraphQLBuilder(optionsSupplier);
}
@Bean
@ConditionalOnMissingBean
- public GraphQLInvoker graphQLInvoker(GraphQLBuilder graphQLBuilder,
+ public GraphQLInvoker graphQLInvoker(
+ GraphQLBuilder graphQLBuilder,
BatchedDataLoaderGraphQLBuilder batchedDataLoaderGraphQLBuilder) {
return new GraphQLInvoker(graphQLBuilder, batchedDataLoaderGraphQLBuilder);
}
@@ -136,8 +136,8 @@ public ReactiveSubscriptionsProtocolFactory subscriptionProtocolFactory(
GraphQLObjectMapper graphQLObjectMapper,
GraphQLSubscriptionInvocationInputFactory invocationInputFactory,
GraphQLInvoker graphQLInvoker,
- @Autowired(required = false) Collection connectionListeners
- ) {
+ @Autowired(required = false)
+ Collection connectionListeners) {
Set listeners = new HashSet<>();
if (connectionListeners != null) {
listeners.addAll(connectionListeners);
@@ -146,11 +146,7 @@ public ReactiveSubscriptionsProtocolFactory subscriptionProtocolFactory(
listeners.add(new KeepAliveSubscriptionConnectionListener());
}
return new ReactiveApolloSubscriptionProtocolFactory(
- graphQLObjectMapper,
- invocationInputFactory,
- graphQLInvoker,
- listeners
- );
+ graphQLObjectMapper, invocationInputFactory, graphQLInvoker, listeners);
}
@Bean
@@ -171,5 +167,4 @@ public HandlerMapping webSocketHandlerMapping(
WebSocketHandlerAdapter webSocketHandlerAdapter() {
return new WebSocketHandlerAdapter();
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfiguration.java b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfiguration.java
index 11a89c18..953c13c4 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfiguration.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/main/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfiguration.java
@@ -23,19 +23,13 @@ public class MonoAutoConfiguration {
@Bean
GenericWrapper monoWrapper(@Autowired(required = false) List genericWrappers) {
if (notWrapsMono(genericWrappers)) {
- return GenericWrapper.withTransformer(
- Mono.class,
- 0,
- Mono::toFuture,
- t -> t
- );
+ return GenericWrapper.withTransformer(Mono.class, 0, Mono::toFuture, t -> t);
}
return null;
}
private boolean notWrapsMono(List genericWrappers) {
- return genericWrappers == null ||
- genericWrappers.stream().noneMatch(it -> it.getType().isAssignableFrom(Mono.class));
+ return genericWrappers == null
+ || genericWrappers.stream().noneMatch(it -> it.getType().isAssignableFrom(Mono.class));
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/HelloQuery.java b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/HelloQuery.java
index e93efcd9..74bfad8c 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/HelloQuery.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/HelloQuery.java
@@ -10,5 +10,4 @@ class HelloQuery implements GraphQLQueryResolver {
public Mono hello() {
return Mono.just("Hello world");
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfigurationTest.java b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfigurationTest.java
index e3604074..38aa8129 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfigurationTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoAutoConfigurationTest.java
@@ -20,20 +20,20 @@
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class MonoAutoConfigurationTest {
- @Autowired
- private WebTestClient webTestClient;
+ @Autowired private WebTestClient webTestClient;
@Test
void monoWrapper() throws JSONException {
- val result = webTestClient.post()
- .uri("/graphql")
- .contentType(MediaType.APPLICATION_JSON)
- .bodyValue("{ \"query\": \"query { hello } \"}")
- .exchange()
- .returnResult(String.class);
+ val result =
+ webTestClient
+ .post()
+ .uri("/graphql")
+ .contentType(MediaType.APPLICATION_JSON)
+ .bodyValue("{ \"query\": \"query { hello } \"}")
+ .exchange()
+ .returnResult(String.class);
val response = result.getResponseBody().blockFirst();
val json = new JSONObject(response);
assertThat(json.getJSONObject("data").get("hello")).isEqualTo("Hello world");
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoGenericWrapperAlreadyDefinedTest.java b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoGenericWrapperAlreadyDefinedTest.java
index e497b4a4..afb898e9 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoGenericWrapperAlreadyDefinedTest.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MonoGenericWrapperAlreadyDefinedTest.java
@@ -24,17 +24,18 @@
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class MonoGenericWrapperAlreadyDefinedTest {
- @Autowired
- private WebTestClient webTestClient;
+ @Autowired private WebTestClient webTestClient;
@Test
void monoWrapper() throws JSONException {
- val result = webTestClient.post()
- .uri("/graphql")
- .contentType(MediaType.APPLICATION_JSON)
- .bodyValue("{ \"query\": \"query { hello } \"}")
- .exchange()
- .returnResult(String.class);
+ val result =
+ webTestClient
+ .post()
+ .uri("/graphql")
+ .contentType(MediaType.APPLICATION_JSON)
+ .bodyValue("{ \"query\": \"query { hello } \"}")
+ .exchange()
+ .returnResult(String.class);
val response = result.getResponseBody().blockFirst();
val json = new JSONObject(response);
assertThat(json.getJSONObject("data").get("hello")).isEqualTo("Hello world");
@@ -44,13 +45,7 @@ void monoWrapper() throws JSONException {
static class MonoConfiguration {
@Bean
GenericWrapper genericWrapper() {
- return GenericWrapper.withTransformer(
- Mono.class,
- 0,
- Mono::toFuture,
- t -> t
- );
+ return GenericWrapper.withTransformer(Mono.class, 0, Mono::toFuture, t -> t);
}
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MySubscriptionResolver.java b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MySubscriptionResolver.java
index 70e4995f..bce88263 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MySubscriptionResolver.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/MySubscriptionResolver.java
@@ -13,5 +13,4 @@ class MySubscriptionResolver implements GraphQLSubscriptionResolver {
Publisher hello(DataFetchingEnvironment env) {
return Flux.range(0, 100).delayElements(Duration.ofSeconds(1));
}
-
}
diff --git a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/WebfluxApplication.java b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/WebfluxApplication.java
index a53983f2..5b731dd7 100644
--- a/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/WebfluxApplication.java
+++ b/graphql-kickstart-spring-boot-autoconfigure-webflux/src/test/java/graphql/kickstart/spring/webflux/boot/WebfluxApplication.java
@@ -9,5 +9,4 @@ public class WebfluxApplication {
public static void main(String[] args) {
SpringApplication.run(WebfluxApplication.class, args);
}
-
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/AbstractGraphQLController.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/AbstractGraphQLController.java
index aeaec083..1d3c14b8 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/AbstractGraphQLController.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/AbstractGraphQLController.java
@@ -24,15 +24,18 @@ public abstract class AbstractGraphQLController {
private final GraphQLObjectMapper objectMapper;
- @PostMapping(value = "${graphql.url:graphql}",
- consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
+ @PostMapping(
+ value = "${graphql.url:graphql}",
+ consumes = MediaType.ALL_VALUE,
+ produces = MediaType.APPLICATION_JSON_VALUE)
public Object graphqlPOST(
@RequestHeader(HttpHeaders.CONTENT_TYPE) final MediaType contentType,
@Nullable @RequestParam(value = "query", required = false) String query,
@Nullable @RequestParam(value = "operationName", required = false) String operationName,
@Nullable @RequestParam(value = "variables", required = false) String variablesJson,
@Nullable @RequestBody(required = false) String body,
- ServerWebExchange serverWebExchange) throws IOException {
+ ServerWebExchange serverWebExchange)
+ throws IOException {
body = Optional.ofNullable(body).orElse("");
@@ -41,7 +44,10 @@ public Object graphqlPOST(
if (request.getQuery() == null) {
request.setQuery("");
}
- return executeRequest(request.getQuery(), request.getOperationName(), request.getVariables(),
+ return executeRequest(
+ request.getQuery(),
+ request.getOperationName(),
+ request.getVariables(),
serverWebExchange);
}
@@ -51,20 +57,20 @@ public Object graphqlPOST(
// it should be parsed and handled in the same way as the HTTP GET case.
if (query != null) {
- return executeRequest(query, operationName, convertVariablesJson(variablesJson),
- serverWebExchange);
+ return executeRequest(
+ query, operationName, convertVariablesJson(variablesJson), serverWebExchange);
}
// * If the "application/graphql" Content-Type header is present,
// treat the HTTP POST body contents as the GraphQL query string.
- if ("application/graphql".equals(contentType.toString()) || "application/graphql; charset=utf-8"
- .equals(contentType.toString())) {
+ if ("application/graphql".equals(contentType.toString())
+ || "application/graphql; charset=utf-8".equals(contentType.toString())) {
return executeRequest(body, null, Collections.emptyMap(), serverWebExchange);
}
- throw new ResponseStatusException(HttpStatus.UNPROCESSABLE_ENTITY,
- "Could not process GraphQL request");
+ throw new ResponseStatusException(
+ HttpStatus.UNPROCESSABLE_ENTITY, "Could not process GraphQL request");
}
@GetMapping(value = "${graphql.url:graphql}", produces = MediaType.APPLICATION_JSON_VALUE)
@@ -74,12 +80,13 @@ public Object graphqlGET(
@Nullable @RequestParam(value = "variables", required = false) String variablesJson,
ServerWebExchange serverWebExchange) {
- return executeRequest(query, operationName, convertVariablesJson(variablesJson),
- serverWebExchange);
+ return executeRequest(
+ query, operationName, convertVariablesJson(variablesJson), serverWebExchange);
}
private Map convertVariablesJson(String jsonMap) {
- return Optional.ofNullable(jsonMap).map(objectMapper::deserializeVariables)
+ return Optional.ofNullable(jsonMap)
+ .map(objectMapper::deserializeVariables)
.orElseGet(Collections::emptyMap);
}
@@ -87,7 +94,5 @@ protected abstract Object executeRequest(
String query,
String operationName,
Map variables,
- ServerWebExchange serverWebExchange
- );
-
+ ServerWebExchange serverWebExchange);
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/DefaultGraphQLSpringInvocationInputFactory.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/DefaultGraphQLSpringInvocationInputFactory.java
index ce9fe1ae..6ff7870d 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/DefaultGraphQLSpringInvocationInputFactory.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/DefaultGraphQLSpringInvocationInputFactory.java
@@ -12,18 +12,19 @@
import org.springframework.web.server.ServerWebExchange;
@Getter(AccessLevel.PROTECTED)
-public class DefaultGraphQLSpringInvocationInputFactory implements
- GraphQLSpringInvocationInputFactory {
+public class DefaultGraphQLSpringInvocationInputFactory
+ implements GraphQLSpringInvocationInputFactory {
private final Supplier schemaProviderSupplier;
- private Supplier contextBuilderSupplier = () -> (GraphQLSpringServerWebExchangeContext::new);
- private Supplier rootObjectBuilderSupplier = () -> (serverWebExchange -> new Object());
+ private Supplier contextBuilderSupplier =
+ () -> (GraphQLSpringServerWebExchangeContext::new);
+ private Supplier rootObjectBuilderSupplier =
+ () -> (serverWebExchange -> new Object());
public DefaultGraphQLSpringInvocationInputFactory(
GraphQLSchemaProvider schemaProvider,
GraphQLSpringContextBuilder contextBuilder,
- GraphQLSpringRootObjectBuilder rootObjectBuilder
- ) {
+ GraphQLSpringRootObjectBuilder rootObjectBuilder) {
Objects.requireNonNull(schemaProvider, "GraphQLSchemaProvider is required");
this.schemaProviderSupplier = () -> schemaProvider;
if (contextBuilder != null) {
@@ -37,10 +38,9 @@ public DefaultGraphQLSpringInvocationInputFactory(
public DefaultGraphQLSpringInvocationInputFactory(
Supplier schemaProviderSupplier,
Supplier contextBuilderSupplier,
- Supplier rootObjectBuilderSupplier
- ) {
- this.schemaProviderSupplier = Objects
- .requireNonNull(schemaProviderSupplier, "GraphQLSchemaProvider is required");
+ Supplier rootObjectBuilderSupplier) {
+ this.schemaProviderSupplier =
+ Objects.requireNonNull(schemaProviderSupplier, "GraphQLSchemaProvider is required");
if (contextBuilderSupplier != null) {
this.contextBuilderSupplier = contextBuilderSupplier;
}
@@ -50,20 +50,18 @@ public DefaultGraphQLSpringInvocationInputFactory(
}
@Override
- public GraphQLSingleInvocationInput create(GraphQLRequest graphQLRequest,
- ServerWebExchange serverWebExchange) {
+ public GraphQLSingleInvocationInput create(
+ GraphQLRequest graphQLRequest, ServerWebExchange serverWebExchange) {
return new GraphQLSingleInvocationInput(
graphQLRequest,
schemaProviderSupplier.get().getSchema(),
contextBuilderSupplier.get().build(serverWebExchange),
- rootObjectBuilderSupplier.get().build(serverWebExchange)
- );
+ rootObjectBuilderSupplier.get().build(serverWebExchange));
}
@Override
- public GraphQLBatchedInvocationInput create(Collection graphQLRequests,
- ServerWebExchange serverWebExchange) {
+ public GraphQLBatchedInvocationInput create(
+ Collection graphQLRequests, ServerWebExchange serverWebExchange) {
throw new UnsupportedOperationException("Batch queries not suppoprted yet");
}
-
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContext.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContext.java
index 326441a8..4b74df86 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContext.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContext.java
@@ -6,5 +6,4 @@
public interface GraphQLSpringContext extends GraphQLContext {
ServerWebExchange getServerWebExchange();
-
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContextBuilder.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContextBuilder.java
index 5264ea05..aad1f9dd 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContextBuilder.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringContextBuilder.java
@@ -5,5 +5,4 @@
public interface GraphQLSpringContextBuilder {
GraphQLSpringContext build(ServerWebExchange serverWebExchange);
-
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringInvocationInputFactory.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringInvocationInputFactory.java
index df5a7661..d7028fc9 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringInvocationInputFactory.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringInvocationInputFactory.java
@@ -8,10 +8,9 @@
public interface GraphQLSpringInvocationInputFactory {
- GraphQLSingleInvocationInput create(GraphQLRequest graphQLRequest,
- ServerWebExchange serverWebExchange);
-
- GraphQLBatchedInvocationInput create(Collection graphQLRequests,
- ServerWebExchange serverWebExchange);
+ GraphQLSingleInvocationInput create(
+ GraphQLRequest graphQLRequest, ServerWebExchange serverWebExchange);
+ GraphQLBatchedInvocationInput create(
+ Collection graphQLRequests, ServerWebExchange serverWebExchange);
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringRootObjectBuilder.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringRootObjectBuilder.java
index 786650a0..2016dd62 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringRootObjectBuilder.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringRootObjectBuilder.java
@@ -5,5 +5,4 @@
public interface GraphQLSpringRootObjectBuilder {
Object build(ServerWebExchange serverWebExchange);
-
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringServerWebExchangeContext.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringServerWebExchangeContext.java
index 3186421d..d3d57d69 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringServerWebExchangeContext.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/GraphQLSpringServerWebExchangeContext.java
@@ -5,8 +5,8 @@
import org.dataloader.DataLoaderRegistry;
import org.springframework.web.server.ServerWebExchange;
-public class GraphQLSpringServerWebExchangeContext extends DefaultGraphQLContext implements
- GraphQLSpringContext {
+public class GraphQLSpringServerWebExchangeContext extends DefaultGraphQLContext
+ implements GraphQLSpringContext {
private final ServerWebExchange serverWebExchange;
@@ -14,16 +14,15 @@ public GraphQLSpringServerWebExchangeContext(ServerWebExchange serverWebExchange
this(new DataLoaderRegistry(), serverWebExchange);
}
- public GraphQLSpringServerWebExchangeContext(DataLoaderRegistry dataLoaderRegistry,
- ServerWebExchange serverWebExchange) {
+ public GraphQLSpringServerWebExchangeContext(
+ DataLoaderRegistry dataLoaderRegistry, ServerWebExchange serverWebExchange) {
super(dataLoaderRegistry, null);
- this.serverWebExchange = Objects
- .requireNonNull(serverWebExchange, "Server web exchange cannot be null");
+ this.serverWebExchange =
+ Objects.requireNonNull(serverWebExchange, "Server web exchange cannot be null");
}
@Override
public ServerWebExchange getServerWebExchange() {
return serverWebExchange;
}
-
}
diff --git a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/error/ErrorContext.java b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/error/ErrorContext.java
index c12ecb2e..2492e86c 100644
--- a/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/error/ErrorContext.java
+++ b/graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/error/ErrorContext.java
@@ -12,7 +12,8 @@ public class ErrorContext {
private final Map extensions;
private final ErrorClassification errorType;
- public ErrorContext(List locations,
+ public ErrorContext(
+ List locations,
List