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
Use getters so the base RequestInput is usable for JSON serialization,
e.g. for the testing support.
Remove WebSocketMessageInput which only had an extra requestId and
add that to WebInput instead.
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
Decouple from HandshakeInfo which is WebFlux specific.
Rename the class to WebSocketMessageInput since it's per message.
Use more specific name for id field based on the protocol.
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.
This commit adds a very simple graphiQL integration: we're shipping the
project with a sample graphiQL `index.html` page that's relying on CDNs
to display the explorer.
We're also plugging in that resource at the graphQL endpoint location,
responding to GET requests. This is not a problem since for now we're
only considering POST requests to the endpoint for actual queries.
Closes gh-12
The graphQL spec requires that the `variables` object should not be
null. Prior to this commit, the `Map#getOrDefault` call would not
prevent that since it returns the value associated with the key, if
defined, or the default value. In our case the key is defined but the
value is null.
The GraphQL Spring Boot starters aren't actually necessary.
The typical GraphQL usage is really tied to the type of web application
you're building: Spring MVC or WebFlux.
Adding the `spring-graphql-web` dependency to the classpath is a signal
strong enough that we can configure additional endpoints into the web
application.
Closes gh-17
This commit provides an initial instrumentation for metrics support
with micrometer. The graphQL `SimpleInstrumentation` is used to
intercept query execution and collect execution time as well as specific
tags.
The set and names of metrics and tags are temporary and we should refine
this infrastructure.
Closes gh-16
Prior to this commit, the `GraphQLAutoConfiguration` would only consider
the case where the GraphQL schema is read as an SDL from a configured
location.
GraphQL also supports the programmatic creation of the schema and this
case needs to be supported by the auto-configuration.
This commit updates the auto-configuration to disable the schema
creation from the SDL if a `GraphQL.Builder` bean is already contributed
by the application.
Fixes gh-4
- Remove (unused) GraphQLResponseBody
- Collapse servlet and reactive packages and rename handlers to
WebFluxGraphQLHandler and WebMvcGraphQLHandler.
- Minor refactoring and polishing in each handler also removing some
protected methods that overlap in purpose.
- Rename GraphQLRequestBody to RequestInput and make it package private.