Git Product home page Git Product logo

graphql-java-kickstart / graphql-spring-boot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yandooo/graphql-spring-boot

1.5K 45.0 326.0 10.24 MB

GraphQL and GraphiQL Spring Framework Boot Starters - Forked from oembedler/graphql-spring-boot due to inactivity.

Home Page: https://www.graphql-java-kickstart.com/spring-boot/

License: MIT License

HTML 2.56% Java 97.18% Shell 0.25% JavaScript 0.01%

graphql-spring-boot's Introduction

Warning

THIS REPOSITORY HAS BEEN ARCHIVED AND IS NO LONGER BEING MAINTAINED

Since Spring now officially supports GraphQL we have decided to archive this project. We encourage you to start using Spring for GraphQL instead. If you're projects rely on this library and you really require an update and cannot migrate to Spring for GraphQL yet, then you should fork this repository and make the necessary changes on your own.

GraphQL Spring Boot Starters

Maven Central Sonatype Snapshot GitHub CI Workflow Quality Gate Status GitHub contributors Discuss on GitHub

Table of Contents

Quick start

Using Gradle

Set the Kotlin version in your gradle.properties

kotlin.version=1.3.70

Using Maven

Set the Kotlin version in your <properties> section

<properties>
  <kotlin.version>1.3.70</kotlin.version>
</properties>

Documentation

See our new Documentation.

Requirements and Downloads

Requirements:

  • Java 1.8
  • Spring Framework Boot > 2.x.x (web)

Gradle:

repositories {
    mavenCentral()
}

dependencies {
  implementation 'com.graphql-java-kickstart:graphql-spring-boot-starter:14.0.0'
  
  // testing facilities
  testImplementation 'com.graphql-java-kickstart:graphql-spring-boot-starter-test:14.0.0'
}

Maven:

<dependency>
  <groupId>com.graphql-java-kickstart</groupId>
  <artifactId>graphql-spring-boot-starter</artifactId>
  <version>14.0.0</version>
</dependency>

<!-- testing facilities -->
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-spring-boot-starter-test</artifactId>
<version>14.0.0</version>
<scope>test</scope>
</dependency>

Snapshots

<repositories>
  <repository>
    <id>osshr-snapshots</id>
    <name>osshr-sonatype-snapshots</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
  </repository>
</repositories>

For gradle:

repositories {
  maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

Enable GraphQL Servlet

The servlet becomes accessible at /graphql if graphql-spring-boot-starter added as a dependency to a boot application and a GraphQLSchema bean is present in the application. Check out the simple example for the bare minimum required.

A GraphQL schema can also be automatically created when a supported graphql-java schema library is found on the classpath.

See the graphql-java-servlet usage docs for the avaiable endpoints exposed.

Available Spring Boot configuration parameters (either application.yml or application.properties):

graphql:
  servlet:
    # Sets if GraphQL servlet should be created and exposed. If not specified defaults to "true".
    enabled: true
    # Sets the path where GraphQL servlet will be exposed. If not specified defaults to "/graphql"
    mapping: /graphql
    cors-enabled: true
    cors:
      allowed-origins: http://some.domain.com
      allowed-methods: GET, HEAD, POST
    # if you want to @ExceptionHandler annotation for custom GraphQLErrors
    exception-handlers-enabled: true
    context-setting: PER_REQUEST_WITH_INSTRUMENTATION
    # Sets if asynchronous operations are supported for GraphQL requests. If not specified defaults to true.
    async-mode-enabled: true

By default a global CORS filter is enabled for /graphql/** context. The corsEnabled can be set to false to disable it.

Enable GraphiQL

GraphiQL becomes accessible at the root /graphiql if the graphql.graphiql.enabled property is true.

Note that GraphQL server must be available at /graphql/* context to be discovered by GraphiQL.

Available Spring Boot configuration parameters (either application.yml or application.properties):

graphql:
  graphiql:
    mapping: /graphiql
    endpoint:
      graphql: /graphql
      subscriptions: /subscriptions
    subscriptions:
      timeout: 30
      reconnect: false
    basePath: /
    enabled: true
    pageTitle: GraphiQL
    cdn:
      enabled: false
      version: latest
    props:
      resources:
        query: query.graphql
        defaultQuery: defaultQuery.graphql
        variables: variables.json
      variables:
        editorTheme: "solarized light"
    headers:
      Authorization: "Bearer <your-token>"

By default GraphiQL is served from within the package. This can be configured to be served from CDN instead, by setting the property graphiql.cdn.enabled to true.

You are able to set the GraphiQL props as well. The graphiql.props.variables group can contain any of the props as defined at GraphiQL Usage. Since setting (large) queries in the properties like this isn't very readable, you can use the properties in the graphiql.props.resources group to set the classpath resources that should be loaded.

Headers that are used when sending the GraphiQL queries can be set by defining them in the graphiql.headers group.

Enable Altair

Altair becomes accessible at the root /altair if the graphql.altair.enabled property is true.

Note that GraphQL server must be available at /graphql/* context to be discovered by Altair.

Available Spring Boot configuration parameters (either application.yml or application.properties):

graphql:
  altair:
    enabled: true
    mapping: /altair
    subscriptions:
      timeout: 30
      reconnect: false
    static:
      base-path: /
    page-title: Altair
    cdn:
      enabled: false
      version: 4.0.2
    options:
      endpoint-url: /graphql
      subscriptions-endpoint: /subscriptions
      initial-settings:
        theme: dracula
      initial-headers:
        Authorization: "Bearer <your-token>"
    resources:
      initial-query: defaultQuery.graphql
      initial-variables: variables.graphql
      initial-pre-request-script: pre-request.graphql
      initial-post-request-script: post-request.graphql

By default Altair is served from within the package. This can be configured to be served from CDN instead, by setting the property graphql.altair.cdn.enabled to true.

You are able to set the Altair options as well using the graphql.altair.options group. Since setting ( large) queries in the properties like this isn't very readable, you can use the properties in the graphql.altair.resources group to set the classpath resources that should be loaded.

Enable GraphQL Playground

GraphQL Playground becomes accessible at root /playground (or as configured in graphql.playground.mapping) if the graphql.playground.enabled property is true.

It uses an embedded GraphQL Playground React, in accordance to the official guide, using the 'minimum HTML' approach.

Available Spring Boot configuration parameters (either application.yml or application.properties):

graphql:
  playground:
    mapping: /playground
    endpoint: /graphql
    subscriptionEndpoint: /subscriptions
    staticPath.base: my-playground-resources-folder
    enabled: true
    pageTitle: Playground
    cdn:
      enabled: false
      version: latest
    settings:
      editor.cursorShape: line
      editor.fontFamily: "'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace"
      editor.fontSize: 14
      editor.reuseHeaders: true
      editor.theme: dark
      general.betaUpdates: false
      prettier.printWidth: 80
      prettier.tabWidth: 2
      prettier.useTabs: false
      request.credentials: omit
      schema.polling.enable: true
      schema.polling.endpointFilter: "*localhost*"
      schema.polling.interval: 2000
      schema.disableComments: true
      tracing.hideTracingResponse: true
    headers:
      headerFor: AllTabs
    tabs:
      - name: Example Tab
        query: classpath:exampleQuery.graphql
        headers:
          SomeHeader: Some value
        variables: classpath:variables.json
        responses:
          - classpath:exampleResponse1.json
          - classpath:exampleResponse2.json

Basic settings

mapping, endpoint and subscriptionEndpoint will default to /playground, /graphql and /subscriptions, respectively. Note that these values may not be empty.

enabled defaults to true, and therefor Playground will be available by default if the dependency is added to a Spring Boot Web Application project.

pageTitle defaults to Playground.

headers allows you to specify headers for the default tab. Note that if your are using Spring Security and CSRF is enabled CSRF, the CSRF token will be automatically added to the headers. These headers will also be added to all the tabs configured under the Tabs section. If a header is defined both in this 'global' header list and the header list of the individual tabs, the 'local' version will be used for that tab.

CDN

The currently bundled version is 1.7.20, which is - as of writing this - the latest release of GraphQL Playground React. 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. The CDN option is disabled by default.

Custom static resources

You can also specify a custom local version of Playground by setting the base path for Playground resources in the staticPath.base property. Under this directory, you have to provide the following files:

  • static/css/index.css
  • static/js/middleware.js
  • favicon.png
  • logo.png

This is identical to the directory structure of the CDN under the build subfolder (where these files can be found).

Customizing GraphQL Playground

Further GraphQL Playground settings can be specified under the settings group, which are documented in the official GraphQL Playground readme. Note that enum-like values are validated against the available options, and your application will not start if wrong settings are provided. Similarly there is some basic validation for integer values (they must be valid positive integers).

Tabs

Optionally, you can specify tabs that will be present when the user first opens GraphQL Playground. You can configure the query, variables, headers and even supply sample responses. Note that query , 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 the graphql.voyager.enabled property is true.

Available Spring Boot configuration parameters (either application.yml or application.properties):

graphql:
  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

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. 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.

Supported GraphQL-Java Libraries

The following libraries have auto-configuration classes for creating a GraphQLSchema.

GraphQL Java Tools

https://github.com/graphql-java-kickstart/graphql-java-tools

All GraphQLResolver and GraphQLScalar beans, along with a bean of type SchemaParserDictionary (to provide all other classes), will be used to create a GraphQLSchema. Any files on the classpath named *.graphqls will be used to provide the schema definition. See the Readme for more info.

Available Spring Boot configuration parameters (either application.yml or application.properties):

graphql:
  tools:
    schema-location-pattern: "**/*.graphqls"
    # Enable or disable the introspection query. Disabling it puts your server in contravention of the GraphQL
    # specification and expectations of most clients, so use this option with caution
    introspection-enabled: true

By default GraphQL tools uses the location pattern **/*.graphqls to scan for GraphQL schemas on the classpath. Use the schemaLocationPattern property to customize this pattern.

GraphQL Annotations

https://github.com/Enigmatis/graphql-java-annotations

To use GraphQL Annotations library instead of GraphQL Java Tools, set the graphql.schema-strategy property to annotations.

The schema will be built using the GraphQL Annotations library in a code-first approach - instead of writing it manually, the schema will be constructed based on the Java code. Please see the documentation of the GraphQL Annotations library for a detailed documentation of the available annotations. This readme focuses on how GraphQL Annotations - GraphQL Spring Boot Starter integration works.

Configuration

graphql:
    annotations:
        base-package: com.example.graphl.schema # required
        always-prettify: true #true is the default value, no need to specify it

The most important parameter is the base package. The starter will look for schema-relevant classes in the specified package and its subpackages. always-prettify will "prettify" getter/setter methods - the get/set/is prefix will be removed from GraphQL fields automatically.

Root resolvers, directives, type extensions

The root resolvers must be marked with the GraphQLQueryResolver, GraphQLMutationResolver and GraphQLSubscription annotations (not to be confused with the marker interfaces from the GraphQL Java Tools library).

Important:

Unlike GraphQL Java Tools, GraphQL Annotations only supports one of them each. Furthermore, GraphQL Annotations only accepts a class as input, not an instance. It will either create a new instance of the class itself, or use static methods. This means that Spring dependency injection will not work in the usual way. The companion example project (which can be found in the samples repository) demonstrates possible workarounds for this issue.

GraphQLDirectiveDefinition and GraphQLTypeExtension-annotated classes are subject to the same limitation regarding dependency injection - but there can be any number of them.

Interfaces

Interfaces in the configured package having at least one of their methods marked as @GraphQLField are considered a GraphQL interface, and their implementations are automatically added to the schema. Furthermore, you have to add the following annotation to GraphQL interfaces: @GraphQLTypeResolver(GraphQLInterfaceTypeResolver.class)

Custom scalars and type functions

Custom scalars can be defined in the same way as in the case of using GraphQL Java Tools - just define the GraphQLScalarType beans.

The starter will also pick up TypeFunction beans and pass them to the schema builder.

In these cases the actual beans will be used, not just the classes. Spring dependency injection works as usual.

Custom Relay and GraphQL Annotation Processor

It is possible to define a bean implementing Relay and/or GraphQLAnnotations. If present, these will be passed to the schema builder. Spring dependency injection works as usual. Note that GraphQL Annotations provides default implementation for these which should be sufficient is most cases.

Extended scalars

Extended scalars can be enabled by using the graphql.extended-scalars configuration property, e. g.:

graphql:
  extended-scalars: BigDecimal, Date

The available scalars are the following: BigDecimal, BigInteger, Byte, Char, Date, DateTime, JSON, LocalTime (since 13.0.0), Locale, Long, NegativeFloat, NegativeInt, NonNegativeFloat, NonNegativeInt, NonPositiveFloat,NonPositiveInt, Object, PositiveFloat, PositiveInt, Short, Time, UUID (since 13.0.0), Url.

This setting works with both the GraphQL Java Tools and the GraphQL Annotations integration.

When using the GraphQL Java Tools integration, the scalars must also be declared in the GraphQL Schema:

scalar BigDecimal
scalar Date

Aliased scalars

Requires version 13.0.0 or greater

The starter also supports aliased scalars. You can define aliases for any standard or extended scalar, as shown in the example below. Note that the original extended scalar (BigDecimal) will not be available. You have to use graphql.extended-scalars property to declare it.

graphql:
  aliased-scalars:
    BigDecimal: Number, Decimal
    String: Text

When using the GraphQL Java Tools integration, the aliased scalars must also be declared in the GraphQL Schema:

scalar Number
scalar Decimal
scalar Text

Note: Custom scalar beans cannot be aliased this way. If you need to alias them, you have to manually declare the aliased scalar bean.

Tracing and Metrics

Apollo style tracing along with two levels of metrics based on them are currently configurable. Full tracing is based on the GraphQL java implementation, and can be enabled in the application.yml or application.properties file:

graphql:
  servlet:
    tracing-enabled: true

the default value is false, with "metrics-only" being available. Metrics-only does not add the tracing extension to the response.

Metrics utilize one of two forms of tracing to feed information to Micrometer. If tracing is enabled, or set to "metrics-only", full tracing metrics will be collected, otherwise a tracing implementation that does not collect field data will be injected. Metrics can be configured in the application.yml or application.properties to either true or false, with a default of false:

graphql:
  servlet:
    actuator-metrics: true

Usage

See Baeldung Spring Boot Actuators for the basics of using Actuator. Add spring-boot-starter-actuator to your project as dependency.

The following metrics are available for exposure:

  • graphql.timer.query
  • 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 the Code of Conduct.

Licenses

graphql-spring-boot-starter is licensed under the MIT License. See LICENSE for details.

graphql-java License

graphiql License

graphql-js License

graphql-spring-boot's People

Contributors

actions-user avatar aoudiamoncef avatar apottere avatar aviadavretz avatar bakert avatar blasiussecundus avatar blaugold avatar bsara avatar dcoraboeuf avatar devopsix avatar donbeave avatar jeskew-gov avatar jmccaull avatar liqweed avatar m1ngyuan avatar maxdavidguenther avatar oembedler avatar oliemansm avatar pshirishreddy avatar pstarritt-evooq avatar punchcafe avatar ravikrn13 avatar renovate-bot avatar renovate[bot] avatar seongahjo avatar setchy avatar simulant87 avatar tmkhanh avatar tomas-c avatar vojtapol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphql-spring-boot's Issues

Are subscriptions over websockets supported?

I'm trying to use graphql-spring-boot with graphql-java-tools to setup an example delivering subscriptions responses over websocket. There's no documentation covering this example, only for querying over HTTP. Is this possible, can the starter be configured to use websockets?

adding tracing instrumentation

Hi, correct me if I'm wrong.
With the graphql-spring-boot-starter, it will handle the bean creation for these object : GraphQL ,GraphQLSchema, SchemaParser, etc.
and I'm interested with the tracing instrumentation (http://graphql-java.readthedocs.io/en/v6/instrumentation.html) which add TracingInstrumentation to the GraphQL object
I tried to add the tracing instrumentation to my GraphQL object but there's no change to my response
here is how I try to add the TracingInstrumentation object to my GraphQL object
`
@SpringBootApplication
public class DemographqlApplication {

public static void main(String[] args) {
    SpringApplication.run(DemographqlApplication.class, args);
}

@Bean
public GraphQL graphQL(GraphQLSchema graphQLSchema) {
    return GraphQL.newGraphQL(graphQLSchema)
            .instrumentation(new TracingInstrumentation())
            .build();
}

}`

Am I missing something here ?

Thank you

Graphiql Docs add <br>tag

Docs display can't support wrap.

type Query {
    # get user by id <br>
    # @param id user id
    userById(id:Int = 100):User
}

spring-graphql-common is out of sync with graphql-java

The latest version of graphql-java (3.0.0) changed DataFetchingEnvironment to an interface instead of a class, but spring-graphql-common inside of ReflectionGraphQLDataFetcher is expecting DataFetchingEnvironment to be a class leading to a runtime exception being thrown.

Technically this issue is with spring-graphql-common, but it looks like that project hasn't had an update in over a year. There do appear to be several forks, including one that has updated the dependency to use graphql-java 3.0.0, but that fork doesn't seem to exist on any nexus repo requiring that you check out and build that fork in order to work around it.

Until spring-graphql-common is updated the version of graphql-java should be constrained to an earlier version, or else support for spring-graphql-common needs to be temporarily disabled.

Unsure how to throw my own errors

I'm new to both GraphQL and Spring boot, so bear with me please.

I'd like to throw my own errors, instead of getting the

{
  "data": {
    "workflows": {
      "delete": null
    }
  },
  "errors": [
    {
      "message": "Internal Server Error(s) while executing query"
    }
  ]
}

I'm using the graphql-java-tools support and letting the starter auto configure everything. Just have the schema.graphqls in classpath and some Spring beans, that implement com.coxautodev.graphql.tools.GraphQLResolver.

I initially tried to code my resolver methods like so

public String resolverMethod(String key) throws Exception {
    ...
    if (...some validation...) {
        ... some post validation ...
    } else {
        throw new graphql.GraphQLException("Validation failed");
    }
    ...
}

but in the end I get same error as before, and the Exception only appears in my server logs.

I read somewhere that it's the graphql servlet hiding the exception, but I don't know how to modify the servlet, since it's automatically created and configured by the Spring boot starter.

Long story short, I wanna know if I can return my own errors, while still using the Spring boot starter, or will I need to stop using it and configure everything manually from scratch?

auto configurer depends on clauses wrong

GraphQLJavaToolsAutoConfiguration defines a GraphQLSchema bean if neither a GraphQLSchema nor a GraphQLSchemaProvider bean are already defined.

GraphQLWebAutoConfiguration has a ConditionalOnBean that specifies both a GraphQLSchema and a GraphQLSchemaProvider bean must already exist.

Inside of GraphQLWebAutoConfiguration there's a definition for a GraphQLSchemaProvider bean with a ConditionalOnMissingBean annotation that would prevent it from being instantiated if it already exists.

The ConditionalOnBean annotation of GraphQLWebAutoConfiguration is in direct opposition to the ConditionalOnMissingBean annotation of the GraphQLSchemaProvider bean. Because of this circular relationship either no GraphQLSchemaProvider bean exists in a project, in which case GraphQLWebAutoConfiguration is never run, or else a GraphQLSchemaProvider does exist, in which case the GraphQLSchemaProvider bean defined in GraphQLWebAutoConfiguration is never run.

I can see that the intended logic was for GraphQLWebAutoConfiguration to run if either a GraphQLSchema or a GraphQLSchemaProvider bean exist in a project, however the semantics of the ConditionalOnBean annotation are that all classes provided must exist, not just any. Additionally putting that annotation at the class level is treated as if the annotation has been applied to each bean individually which means the GraphQLSchemaProvider been has an effective condition of @ContitionalOnMissingBean(GraphQLSchemaProvider.class) @ConditionalOnBean(GraphQLSchemaProvider.class) which is of course a no-op.

GraphQL starter duplicates classpath when jar is soft symlinked

GraphQLJavaToolsAutoConfiguration#schemaParser finds resources using a wildcard match. This matches soft symlinks as well causing issues like:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLSchemaProvider' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLSchemaProvider' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphQLSchema' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLJavaToolsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'graphQLSchema' threw exception; nested exception is graphql.AssertException: field NON-DUPLICATED-FIELD-HERE redefined
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)

This seems to only happen if we use the extend type QueryType syntax though.

The fix at first glance seemed simple, just check if the file is a symlink, but when attempting to make a PR for this problem I immediately came across a problem because jars are not 'on the filesystem' as a spring Resource.

The lines causing the problem are here. https://github.com/graphql-java/graphql-spring-boot/blob/master/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLJavaToolsAutoConfiguration.java#L51-L54

Build failure

Upon firing
./gradlew --refresh-dependencies --info clean build

Getting following error!
FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ':graphql-sample-app:compileClasspath'.

Could not find any matches for org.webjars.npm:graphql-language-service-interface:[0.0.16,0.0.17) as no versions of org.webjars.npm:graphql-language-service-interface are available.
Required by:
project :graphql-sample-app > project :graphiql-spring-boot-starter > project :graphiql-spring-boot-autoconfigure > org.webjars.npm:graphiql:0.10.1 > org.webjars.npm:codemirror-graphql:0.6.9
Could not find any matches for org.webjars.npm:graphql-language-service-parser:[0.0.14,0.0.15) as no versions of org.webjars.npm:graphql-language-service-parser are available.
Required by:
project :graphql-sample-app > project :graphiql-spring-boot-starter > project :graphiql-spring-boot-autoconfigure > org.webjars.npm:graphiql:0.10.1 > org.webjars.npm:codemirror-graphql:0.6.9

help,invoke error

when i start the sample application, throw exception as blow:
is there some bugs or i use it with incorrect way

java.lang.IncompatibleClassChangeError: Found interface graphql.schema.DataFetchingEnvironment, but class was expected
at com.oembedler.moon.graphql.engine.ReflectionGraphQLDataFetcher.collectBindByClassValues(ReflectionGraphQLDataFetcher.java:89) ~[spring-graphql-common-2.1.0-2016-05-22T16-50-32.jar:na]
at com.oembedler.moon.graphql.engine.ReflectionGraphQLDataFetcher.get(ReflectionGraphQLDataFetcher.java:69) ~[spring-graphql-common-2.1.0-2016-05-22T16-50-32.jar:na]
at graphql.execution.ExecutionStrategy.resolveField(ExecutionStrategy.java:66) ~[graphql-java-2.4.0.jar:na]
at graphql.execution.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:18) ~[graphql-java-2.4.0.jar:na]
at graphql.execution.Execution.executeOperation(Execution.java:85) ~[graphql-java-2.4.0.jar:na]
at graphql.execution.Execution.execute(Execution.java:44) ~[graphql-java-2.4.0.jar:na]
at graphql.GraphQL.execute(GraphQL.java:201) ~[graphql-java-2.4.0.jar:na]
at graphql.servlet.GraphQLServlet.query(GraphQLServlet.java:274) [graphql-java-servlet-3.0.1.jar:na]
at graphql.servlet.GraphQLServlet.lambda$new$1(GraphQLServlet.java:187) [graphql-java-servlet-3.0.1.jar:na]
at graphql.servlet.GraphQLServlet.doRequest(GraphQLServlet.java:230) [graphql-java-servlet-3.0.1.jar:na]
at graphql.servlet.GraphQLServlet.doPost(GraphQLServlet.java:248) [graphql-java-servlet-3.0.1.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) [tomcat-embed-core-8.5.11.jar:8.5.11]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:108) [spring-boot-actuator-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) [spring-boot-actuator-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.11.jar:8.5.11]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.11.jar:8.5.11]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]

Dependency Error in graphiql-spring-boot-starter

Failed to collect dependencies at com.graphql-java:graphiql-spring-boot-starter:jar:3.3.0 -> com.graphql-java:graphiql-spring-boot-autoconfigure:jar:3.3.0 -> org.webjars.npm:react:jar:15.5.4 -> org.webjars.npm:fbjs:jar:0.9.0-alpha.2 -> org.webjars.npm:fbjs-css-vars:jar:[1.0.0,2): No versions available for org.webjars.npm:fbjs-css-vars:jar:[1.0.0,2) within specified range

How to configure object mapper

When a query returns an empty set I get a serialisation error:

com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class graphql.execution.TypeInfo and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.HashMap["errors"]->java.util.ArrayList[0]->graphql.execution.NonNullableFieldWasNullException["typeInfo"])
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:284) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.SerializerProvider.mappingException(SerializerProvider.java:1110) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1135) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:69) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:32) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:689) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:633) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:536) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:30) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:292) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3697) ~[jackson-databind-2.8.9.jar:2.8.9]
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3073) ~[jackson-databind-2.8.9.jar:2.8.9]
	at graphql.servlet.GraphQLServlet.query(GraphQLServlet.java:281) [graphql-java-servlet-4.2.0.jar:na]
	at graphql.servlet.GraphQLServlet.lambda$new$1(GraphQLServlet.java:185) [graphql-java-servlet-4.2.0.jar:na]
	at graphql.servlet.GraphQLServlet.doRequest(GraphQLServlet.java:222) [graphql-java-servlet-4.2.0.jar:na]
	at graphql.servlet.GraphQLServlet.doPost(GraphQLServlet.java:240) [graphql-java-servlet-4.2.0.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [tomcat-embed-core-8.5.16.jar:8.5.16]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.16.jar:8.5.16]

I've tried configuring the object mapper in the usual ways (for spring boot) but none worked.
I've tried both setting the property spring.jackson.serialization.fail_on_empty_beans=false, and defining a Jackson2ObjectMapperBuilder bean.

    @Bean
    Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
        final Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder = new Jackson2ObjectMapperBuilder();
        jackson2ObjectMapperBuilder.configure(objectMapper);
        return jackson2ObjectMapperBuilder;
    }

Store locally graphiql cdn sources

Can you add an ability to store graphiql sources (js/css) locally but not download from cdn? Or write a little guide on how to do it now?

Need to have ability to configure dataloader

Hi, based on the example here, I've set up the following Spring config in the context of a Spring Boot app levering the present project:

@Configuration
@Slf4j
public class DataLoaderConfig {

    @Autowired
    private Dao<Author>    authorDao;

    @Autowired
    private Dao<Publisher> publisherDao;

    @Autowired
    private Dao<Book>      bookDao;

    @Bean
    public Instrumentation instrumentation() {
        log.info("Creating GraphQL execution instrumentation");

        final AuthorBatchLoader    authorBatchLoader    = new AuthorBatchLoader(authorDao);
        final BookBatchLoader      bookBatchLoader      = new BookBatchLoader(bookDao);
        final PublisherBatchLoader publisherBatchLoader = new PublisherBatchLoader(publisherDao);


        final DataLoader<Integer, Author>    authorDataLoader    = new DataLoader<>(authorBatchLoader);
        final DataLoader<Integer, Book>      bookDataLoader      = new DataLoader<>(bookBatchLoader);
        final DataLoader<Integer, Publisher> publisherDataLoader = new DataLoader<>(publisherBatchLoader);

        final DataLoaderRegistry registry = new DataLoaderRegistry();
        registry.register("authors", authorDataLoader);
        registry.register("books", bookDataLoader);
        registry.register("publishers", publisherDataLoader);

        return new DataLoaderDispatcherInstrumentation(registry);
    }
}

And BTW, I'm using the resolver support, as in the following:

@RequiredArgsConstructor
public class AuthorResolver implements GraphQLResolver<Author> {

    private final Dao<Author> authors;

    public Author author(int id) {
        return authors.findById(id);
    }

    public List<Author> authors(int index, int maxResults) {
        return authors.paginate(index, maxResults);
    }

}

There seems to be a bit of abstraction involved, and I'm uncertain about how resolvers correspond to data fetchers (I suspecting that my resolvers are invoked by some generic that fetcher wrapping them). So I'm not clear as to how this type of abstraction may play into the data loading I've configured being used or not...

At runtime, I can see the the SimpleGraphQLServlet instance uses the DataLoaderDispatcherInstrumentation created above (added traces that show the servlet holding the instrumentation instance), but the instrumentation is not being used for loading. Not sure how to wire things up in the context of the Spring Boot starter so that Dataloader is used, there's no doc I could find on the topic. It would be very useful to be able to benefit from the Dataloader support when using the Spring Boot starter.

Can you provide steps to move forward? Thanks.

Allow developers to set the GraphiQL default query and variables

I would like set the default query and variables used by GraphiQL so I can easily share useful queries for my schema, and keep track of changes in source control.

As the default query that I'd like to set is very large, I'd like to set this in a separate file, though if I could set it just in application.properties similarly to the pageTitle that would be great.

java.lang.IncompatibleClassChangeError: Found interface graphql.schema.DataFetchingEnvironment, but class was expected

I'm running graphql-spring-boot at it's latest 3.2.0 and I seem to get the stacktrace regarding the DataFetchingEnvironment (provided at the end)?

My graphql query looks like this:

{
  organisation {
    name,
    id
  }
}

The GraphQLSchemaQuery of my API looks like this:

@GraphQLObject("GraphQLApi")
public class QueryApi {
    @GraphQLNonNull
    @GraphQLField("version")
    @GraphQLDescription("The version number of this API")
    public static final String VERSION = "0.1-springboot-alpha";

    @Autowired
    @GraphQLIgnore
    private OrganisationService organisationService;

    @GraphQLField("organisations")
    public List<Organisation> getOrganisations() {
        return organisationService.getOrganisations();
    }

    @GraphQLField("organisation")
    public Organisation getOrganisation(@GraphQLIn("id") Integer id) {
        return organisationService.getOrganisation(id);
    }
}

When I query for { version } then data is returned. But when I query either organisation fields, then I get the error on the server side.

java.lang.IncompatibleClassChangeError: Found interface graphql.schema.DataFetchingEnvironment, but class was expected
	at com.oembedler.moon.graphql.engine.ReflectionGraphQLDataFetcher.collectBindByClassValues(ReflectionGraphQLDataFetcher.java:89) ~[spring-graphql-common-2.1.0-2016-05-22T16-50-32.jar:na]
	at com.oembedler.moon.graphql.engine.ReflectionGraphQLDataFetcher.get(ReflectionGraphQLDataFetcher.java:69) ~[spring-graphql-common-2.1.0-2016-05-22T16-50-32.jar:na]
	at graphql.execution.ExecutionStrategy.resolveField(ExecutionStrategy.java:66) ~[graphql-java-2.4.0.jar:na]
	at graphql.execution.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:18) ~[graphql-java-2.4.0.jar:na]
	at graphql.execution.Execution.executeOperation(Execution.java:85) ~[graphql-java-2.4.0.jar:na]
	at graphql.execution.Execution.execute(Execution.java:44) ~[graphql-java-2.4.0.jar:na]
	at graphql.GraphQL.execute(GraphQL.java:201) ~[graphql-java-2.4.0.jar:na]
	at graphql.servlet.GraphQLServlet.query(GraphQLServlet.java:274) [graphql-java-servlet-3.0.1.jar:na]
	at graphql.servlet.GraphQLServlet.lambda$new$1(GraphQLServlet.java:187) [graphql-java-servlet-3.0.1.jar:na]
	at graphql.servlet.GraphQLServlet.doRequest(GraphQLServlet.java:230) [graphql-java-servlet-3.0.1.jar:na]
	at graphql.servlet.GraphQLServlet.doPost(GraphQLServlet.java:248) [graphql-java-servlet-3.0.1.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.0.RC1.jar:5.0.0.RC1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.15.jar:8.5.15]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]

Adding the Service class just in case.

@Service
public class OrganisationServiceImpl implements OrganisationService {
    private List<Organisation> organisations = new ArrayList<>(Arrays.asList(
            new Organisation("Home", "HOME"),
            new Organisation("Shiraaz", "SHIR"),
    ));

    public Organisation getOrganisation(Integer id) {
        return organisations.get(id);
    }

    public List<Organisation> getOrganisations() {
        return organisations;
    }

    @Override
    public Organisation addOrganisation(String name, String id) {
        final Organisation result = new Organisation(name, id);
        organisations.add(result);

        return result;
    }
}

Spring security - Handle exceptions from authentication filters

Hi,

thanks for your very convenient libraries. I've got the following problem and hope you might be able to help me solve it: I am creating a backend that uses Spring Data and Security alongside GraphQL-Java. So far it seems as if everything works as I expected it but now i wonder how I could handle errors that get thrown during the authentication phase of the application. I have implemented a custom authentication filter and provider where the request (user/registered client) get identified. Naturally, there can be exceptions fired.

It seems as if the Custom GraphQLErrorHandler that I implemented according to another issue here on this tracker only catches and handles exceptions thrown during the actual Graphql data fetching phase, errors from before are ignored and the server responds just with something like this:

{ "timestamp": 1508620919395, "status": 403, "error": "Forbidden", "message": "Access Denied", "path": "/graphql" }

Is there anything I can do or do I just have to accept this message for all authentication related errors? I would really like to include information for a user as to what went wrong (it can be a number of things).

Kind regards,
Daniel

Spring subscription example

I have found the following example https://github.com/graphql-java/graphql-java-subscription-example which use graphql-java for subscriptions over a websocket.

I have been trying to do the same idea within the spring version but have not been able to understand how it fits together. Do we have a spring version of the example above, or something similar?

I have been struggling to understand how the Publisher from GraphQLSubscriptionResolver fits together with websockets.

Property to change GraphiQL's /graphql endpoint

Our app exists behind a zuul router, so even with the default mapping of /graphql and /graphiql, /graphiql is not able to find /graphql. Is there anyway to add a property to the graphiql config to change the location it looks for graphql?

Cannot make requests from other origin

Hello,

I have a graphql api set up with this project, and I'm trying to make a request from a GUI hosted elsewhere.

However, the OPTIONS request always return the following :

HTTP/1.1 200
Allow: GET, HEAD, POST, OPTIONS
Content-Length: 0
Date: Wed, 17 May 2017 19:01:38 GMT

And then the browser doesn't perform the request.

I have tried true/false for the property graphql.servlet.corsEnabled, but this didn't change anything.

Do you know How I could configure my app to allow cross-origin requests ?

Configure GraphQLServlet object mapper

It's possible to configure the object mapper used by the GraphQLServlet via a custom implementation of the (functional) interface ObjectMapperConfigurer (see graphql-java-kickstart/graphql-java-servlet@8f55785).

I would expect it to be possible to register a bean of such implementation in the application context and have it injected in the GraphQLServlet. However this doesn't seem to be possible yet.

Here's what I'm trying to do:

@SpringBootApplication
public class Application {

(...)

    @Bean
    ObjectMapperConfigurer objectMapperConfigurer() {
        return (ObjectMapper mapper) -> mapper.registerModule(new JavaTimeModule());
    }

(...)

}

Is this something that needs to be implemented yet? Or am I going about it the wrong way?

The usage of starter modules

Hi,

Can I just add these two dependencies instead of starter to the pom.xml?

graphiql-spring-boot-autoconfigure
graphql-spring-boot-autoconfigure

What's the usage of another two starter modules:
graphiql-spring-boot-starter
graphql-spring-boot-starter

Thanks.

Add samples of how to test Graph QL Controller layer

Hi

I want to create an integration test for the graphQL processing layer mocking the underlying services. That is, test it like any other controllers, and post proper graphQL queries. I tried to get it working using WebMvcTest or SpringBootTest but was not successful. I think a sample will be very useful.

@RunWith(SpringRunner.class)
@WebMvcTest
@AutoConfigureMockMvc(secure=false)
public class GraphQLControllerTest {
@Autowired
WebApplicationContext applicationContext;

@Autowired
MockMvc mockMvc;

@MockBean
MyService mockMyService;
....
`

Unable to compile the latest source code

D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:22:
error: cannot find symbol
import com.oembedler.moon.graphql.GraphQLSchemaBeanFactory;
^
symbol: class GraphQLSchemaBeanFactory
location: package com.oembedler.moon.graphql
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:23:
error: cannot find symbol
import com.oembedler.moon.graphql.SpringGraphQLSchemaBeanFactory;
^
symbol: class SpringGraphQLSchemaBeanFactory
location: package com.oembedler.moon.graphql
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:24:
error: package com.oembedler.moon.graphql.engine does not exist
import com.oembedler.moon.graphql.engine.GraphQLSchemaBuilder;
^
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:25:
error: package com.oembedler.moon.graphql.engine does not exist
import com.oembedler.moon.graphql.engine.GraphQLSchemaConfig;
^
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:26:
error: package com.oembedler.moon.graphql.engine.stereotype does not exist
import com.oembedler.moon.graphql.engine.stereotype.GraphQLSchema;
^
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:57:
error: cannot find symbol
public GraphQLSchemaBeanFactory graphQLSchemaBeanFactory() {
^
symbol: class GraphQLSchemaBeanFactory
location: class SpringGraphQLCommonAutoConfiguration
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:63:
error: cannot find symbol
public GraphQLSchemaConfig graphQLSchemaConfig() {
^
symbol: class GraphQLSchemaConfig
location: class SpringGraphQLCommonAutoConfiguration
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:87:
error: cannot find symbol
public GraphQLSchemaBuilder graphQLSchemaBuilder() {
^
symbol: class GraphQLSchemaBuilder
location: class SpringGraphQLCommonAutoConfiguration
D:\Labs\graphql-spring-boot-master\graphql-spring-boot-autoconfigure\src\main\ja
va\com\oembedler\moon\graphql\boot\SpringGraphQLCommonAutoConfiguration.java:45:
error: cannot find symbol
@ConditionalOnClass(GraphQLSchemaConfig.class)
^
symbol: class GraphQLSchemaConfig
9 errors
:graphql-spring-boot-autoconfigure:compileJava FAILED

FAILURE: Build failed with an exception.

It's caused by the missing dependency

Support for Spring Boot 2.0

I've just tried it out, and whilst this project works great with Spring 5.0.0 and Spring Boot 1.5.x, it fails when using Spring Boot 2.0.x. The "graphiql-spring-boot" project works fine, but the actual GraphQL handlers don't ever start.

Parse post requests to check authentication

Hi,

for every request I need to check HttpRequest authorization header to see if it contains a valid token if not I want to set the response status to 401 so that the client can handle it. What it is the best practice for this? I can parse requests using

@Bean public List<GraphQLServletListener> listeners(){

or

`@Bean
public GraphQLContextBuilder contextBuilder() throws Exception {
return new GraphQLContextBuilder() {

		@Override
		public GraphQLContext build(Optional<HttpServletRequest> req, Optional<HttpServletResponse> resp){

			System.out.println("IN CONTEXT BUILDER");
			String authHeader = req.get().getHeader("Authorization");
			System.out.println("IN REQUEST LISTENER - authHeader: "+authHeader);`

but I don't know how to stop the current request and "force" the response to 401.

It seems like the only solution is to create my own servlet overriding the doPost method, but there must be a better "spring boot" way I presume.

Thanks for any help.

Accidental Override when create custom exceptions

When i try to create a custom exception that implements GraphQLError cause an Accidental Override in the getMessage error in Kotlin

It's cause because the interface GraphQLError have a abstract method called getMessage(), and the class Throwable also have the same method.

So, the custom exceptions need extends of Throwable and implements GraphQLError and this cause a compiler error "Accidental Override"

override fun getMessage(): String { -> For GraphQLError interface }
override val message: String? -> For Throwable class get() = super.message

Spring Boot Object mapper

Hello,

I there any possibility to share Jackson Object Mapper between Spring Boot and GraphQL?

Instead of duplicating code like this

GraphQL

@Component
public class GraphQlObjectMapperConfigurer implements ObjectMapperConfigurer {
  @Override
  public void configure(ObjectMapper mapper, ObjectMapperConfigurerContext context) {
    mapper.registerModule(new JavaTimeModule())
        .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
  }
}

Spring Boot

@Configuration
public class JacksonConfiguration {

  @Bean
  Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() {
    JavaTimeModule module = new JavaTimeModule();
    return new Jackson2ObjectMapperBuilder()
        .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
        .serializationInclusion(JsonInclude.Include.NON_NULL)
        .findModulesViaServiceLoader(true)
        .modulesToInstall(module);
  }

}

Sample app doesn't autoconfigure servlet

Spun off from #15. The sample app of the current master does start but without a working graphql.

Steps to reproduce:

$ git clone https://github.com/graphql-java/graphql-spring-boot.git
$ cd graphql-spring-boot/graphql-sample-app
$ gradle bootRun

Open graphiql (http://localhost:9000/graphiql). graphiql loads but does not find a graphql endpoint.

{
  "timestamp": 1503588828841,
  "status": 404,
  "error": "Not Found",
  "message": "No message available",
  "path": "/graphql"
}

Hints:

It took me some time to learn that graphql does not start as a normal endpoint. You will find logs like ...

2017-08-24 17:32:05.223  INFO 21175 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/graphiql]}" onto public void com.oembedler.moon.graphiql.boot.GraphiQLController.graphiql(javax

but not for graphql. graphql should be listed like a filter ...

2017-08-24 17:32:04.848  INFO 21175 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'metricsFilter' to: [/*]

If you start the app with MANAGEMENT_SECURITY_ENABLED=false gradle bootRun you can open http://localhost:9000/autoconfig. GraphQLJavaToolsAutoConfiguration is listed there as negativeMatches

GraphQLJavaToolsAutoConfiguration: {
  notMatched: [
    {
      condition: "OnClassCondition",
      message: "@ConditionalOnClass did not find required class 'com.coxautodev.graphql.tools.SchemaParser'"
    }
  ],
  matched: [ ]
},
GraphQLWebAutoConfiguration: {
  notMatched: [
    {
      condition: "OnBeanCondition",
      message: "@ConditionalOnBean (types: 
      graphql.schema.GraphQLSchema,graphql.servlet.GraphQLSchemaProvider; SearchStrategy: all) did not find any beans"
    }
  ],
  matched: [
    {
      condition: "OnClassCondition",
      message: "@ConditionalOnClass found required class 'org.springframework.web.servlet.DispatcherServlet'; @ConditionalOnMissingClass did not find unwanted class"
    },
    {
      condition: "OnWebApplicationCondition",
      message: "@ConditionalOnWebApplication (required) found StandardServletEnvironment"
    },
    {
      condition: "OnPropertyCondition",
      message: "@ConditionalOnProperty (graphql.servlet.enabled=true) matched"
    }
  ]
},

Could not find acceptable representation using starter and graphql-java-tools

If there is any way we could get an example project showing how to use the graphql-java-tools with this project I think it would help. I'm currently getting

{
  "timestamp": "2017-09-14T22:09:30.811+0000",
  "status": 406,
  "error": "Not Acceptable",
  "exception": "org.springframework.web.HttpMediaTypeNotAcceptableException",
  "message": "Could not find acceptable representation",
  "path": "/graphiql",
  "correlationId": "26c68e2b-3c2d-49e9-b6e1-ae57d6e8b24e"
}

with this code


class Query(private val repository: LoanFileViewRepository) : GraphQLQueryResolver {
    fun loanFiles(): List<LoanFile> {
        return repository.findAll().map {
            LoanFile(it.loanId.toString()) //, LoanOfficer(it.loanOfficerId.toString()), LoanProcessor(it.processorId.toString()))
        }
    }
}

@Bean
fun schema(): GraphQLSchema {
    return GraphQLSchema.newSchema().query(GraphQLObjectType.newObject().name("Query").build()).build()
}

class LoanFileResolver : GraphQLResolver<LoanFile>
//class LoanOfficerResolver : GraphQLResolver<LoanOfficer> {
//    fun loanOfficer(id: )
//}

data class LoanFile(
        var id: String
//        var loanOfficer: LoanOfficer,
//        var loanProcessor: LoanProcessor
)

data class LoanOfficer(
    val id: String,
    val name: Name,
    val contactInfo: ContactInfo)

data class LoanProcessor(
    val id: String,
    val name: Name,
    val contactInfo: ContactInfo)

data class Name(
    val first: String,
    val middle: String,
    val last: String,
    val suffix: String
)

data class ContactInfo(
    val phoneNumbers: List<PhoneNumber>,
    val emailAddresses: List<String>
)

data class PhoneNumber(
    val number: String,
    val type: String,
    val extension: String
)

schema {
    query: QueryType
}

type QueryType {
    loanFile(id: String!) : LoanFile
    loanFiles : [LoanFile]
}

type LoanFile {
    id: String!
#    loanOfficer: LoanOfficer
#    loanProcessor: LoanProcessor
}

type LoanOfficer {
    id: String!
    name: Name!
    contactInfo: ContactInfo
}

type LoanProcessor {
    id: String!
    name: Name!
    contactInfo: ContactInfo
}

type Name {
    first: String
    middle: String
    last: String
    suffix: String
}

type ContactInfo {
    phoneNumbers: [PhoneNumber]
    emailAddresses: [String]
}

type PhoneNumber {
    number: String!
    type: String!
    extension: String
}

Disable graphiql in production

Is there a way to have graphiql-spring-boot-starter dependency in the project, but disable it in a particular Spring profile?

Injecting Spring beans into data fetchers

I am puzzled about how should I inject spring beans into data fetchers.
One way could be to pass ApplicationContext into graphQL.execute like this:

@Autowired
ApplicationContext applicationContext
...
graphQL.execute("{query}", applicationContext).<Map<String, Object>> getData()

Then DataFetcher implementation would look like:

class MovieDataFetcher implements DataFetcher<List<Item>> {

    @Override
    List<Item> get(DataFetchingEnvironment environment) {
        ApplicationContext applicationContext = environment.<ApplicationContext> getContext()
        MoviesRepository moviesRepository = applicationContext.getBean(MoviesRepository)
        return moviesRepository.findAll()
    }
}

What is the preferred way to do this with graphql-spring-boot?

Next Release Planned?

Was wondering when the next release so happening. With spring boot 2.0.1 out was hoping to see some of the PR's merged and a release coming out so we can upgrade. Do you have a timeline?

order of GraphQLWebAutoConfiguration

Hi,

i'm facing an issue with ordering of different spring boot starters. I try to mix your starter with another spring starter which defines @order(0). As GraphQLWebAutoConfiguration isn't ordered at all, the default value is used and GraphQLWebAutoConfiguration boots before the other one. I need the order to be the other way around. Do you see any possibility to change this?

2 graphql servlets

I'd like to be able to start 2 or more graphql servlets on different paths. This way I'd be able to configure different security settings per servlet with spring security (e.g. give public access to one while secure the other). Is this a reasonable request?

the config would look like:

graphql:
servlet:
mapping: /graphql, /graphql2

Thanks,

  • Roland

Cannot put graphqls files in a subfolder

Hello,

I've just tried to split my schema.hraphqls file into two files, and I put these two files in a subfolder of my resource folders. Now when I start the application, I get the following exception :

Caused by: java.lang.IllegalStateException: No .graphqls files found on classpath.  Please add a graphql schema to the classpath or add a SchemaParser bean to your application context.
	at com.oembedler.moon.graphql.boot.GraphQLJavaToolsAutoConfiguration.schemaParser(GraphQLJavaToolsAutoConfiguration.java:46) ~[graphql-spring-boot-autoconfigure-3.1.1.jar:na]
	at com.oembedler.moon.graphql.boot.GraphQLJavaToolsAutoConfiguration$$EnhancerBySpringCGLIB$$48ff3ccb.CGLIB$schemaParser$0(<generated>) ~[graphql-spring-boot-autoconfigure-3.1.1.jar:na]
	at com.oembedler.moon.graphql.boot.GraphQLJavaToolsAutoConfiguration$$EnhancerBySpringCGLIB$$48ff3ccb$$FastClassBySpringCGLIB$$b79ceb0b.invoke(<generated>) ~[graphql-spring-boot-autoconfigure-3.1.1.jar:na]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.0.RC1.jar:5.0.0.RC1]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-5.0.0.RC1.jar:5.0.0.RC1]
	at com.oembedler.moon.graphql.boot.GraphQLJavaToolsAutoConfiguration$$EnhancerBySpringCGLIB$$48ff3ccb.schemaParser(<generated>) ~[graphql-spring-boot-autoconfigure-3.1.1.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-5.0.0.RC1.jar:5.0.0.RC1]
	... 22 common frames omitted

Previouslyy, the graphqls file was in src/main/resources, now it's in src/main/resources/graphql.

Is there a way to put these files in a subfolder without creating my own SchemaParser bean ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.