Prior to this commit, the `spring.graphql.schema.location` would only
allow a single file as the source for the GraphQL schema.
This commit changes this configuration to
`spring.graphql.schema.locations` so that it accepts actual locations
(folders) and scans for `*.graphqls` files in those locations. All files
are parsed and merged as a single GraphQL `TypeDefinitionRegistry`.
Closes gh-56
This commit adds a new `spring.graphql.graphiql.path` configuration
property for setting the path to the GraphiQL UI page.
This change requires updates in the static HTML page to link the
JavaScript fetcher back to the actual GraphQL API endpoint.
Closes gh-70
This commit introduces the auto-configuration infrastructure for testing
Spring GraphQL applications with mock/embedded servers.
The new `@AutoConfigureGraphQlTester` annotation can contribute a
`GraphQlTester` bean to the test context for testing the application.
Closes gh-46
- Support for one or more DataFetcherExceptionResolver beans
- ErrorType enum with common error categories
- Default handling of unresolved exceptions as ErrorType.INTERNAL_ERROR
Closes gh-51
Following revisions in the spec
https://github.com/graphql/graphql-spec/pull/777, this commit applies
similar changes to type and method names where feasible.
The chief exception for now is the use of "query" for request input
since that is what it is called in the JSON for GraphQL over HTTP.
This commit changes the default location for the GraphQL schema from
`classpath:schema.graphqls` to `classpath:/graphql/schema.graphqls`.
We're also adding `.graphqlconfig` files that are leveraged by a GraphQL
JS plugin in IntelliJ IDEA.
Closes gh-44
Prior to this commit, we introduced a basic implementation for GraphQL
metrics with Spring GraphQL. The main problem was that we were tracking
the GraphQL queries themselves and those are good candidates for
tags cardinality explosion.
This commit revisits the metrics arrangement and introduces:
* `graphql.request` as the main metric; this tracks the execution of a
single request (i.e. multiple queries)
* `graphql.datafetcher` for tracking data fetching operations.
* `graphql.error` for counting errors.
Closes gh-19
Rename "headers" to "responseHeaders" and clarify those work for HTTP
request queries but not for queries over a WebSocket session.
Update getter for response headers to return a read-only wrapper.
Provide only one public constructor without headers.
See gh-42
Rename to GraphQLService to make it more clear it is a layer below
the specific transport such as HTTP endpoints.
Add WebGraphQLService sub-interface for query execution in web
environment with a WebInterceptor chain.
See gh-42
Prior to this commit, the WebSocket endpoint (MVC or WebFlux) would be
enabled by default. In the case of MVC, the presence of
`spring-websocket` and the required dependencies was an additional hint
that could enable/disable this support depending on the application.
This commit changes the websocket path configuration so that it doesn't
hold a default value anymore. Configuring this property will trigger the
WebSocket support.
Right now developers cannot configure it to be the same as the
`spring.graphql.path`, but this will be solved in #30.
This commit also revisits the configuration properties namespace for
clarity, moving the websocket bits under their own section.
Closes gh-31
This commit ensures that the WebSocket auto-configuration is guarded
with class conditions on WebSocket classes (from the javax API and the
spring-websocket artifact).
This prevents issues where application without such dependencies are
failing at startup.
This commit refactors the project structure to regroup GraphQL web
support under the spring-graphql-web module, and move all the Spring
Boot support classes under a single graphql-spring-boot-starter one.
Right now, the starter module contains everything: classes for MVC,
WebFlux and Actuator support as well as required dependencies. We will
change that in the future.