The default transport-specific client and tester extensions contained
their builder implementations, but it makes more sense the other way
around since the extensions are mainly about the builders they provide.
Use more qualified names [Web|Socket]GraphQlHandlerInterceptor to
differentiate with ClientGraphQlInterceptor and to align with other
types in the same package.
Rename the implementation classes Request[Input|Output] accordingly to
match the interfaces, and move them into the support package.
Create AbstractGraphQlResponse in the support package that
pre-implements response field access.
This leaves mainly contracts in the top-level package.
See gh-332
GraphQlTransport returns ExecutionResult with parsed JSON so for the
most part having MappingProvider is enough. However, when a JSONPath
evaluates to String (vs Map or List), the JsonSmartJsonProvider used by
default, throws UnsupportedOperationException from toJson.
Prior to this commit, the `GraphQlTester#executeAndVerify` method would
check that an `"$.errors"` JSON path exists within the response and
contains no value.
This should fail with valid GraphQL responses, as the spec says that a
response with no error should not contain the errors map at all:
http://spec.graphql.org/draft/#sec-Errors
This commit changes the assertion and instead checks for the absence of
the errors map in the response.
Fixes gh-318
The JSON Encoder and Decoder implementations configured via
CodecConfigurer for HTTP and WebSocket are adapted to a JSONPath
MappingProvider and now automatically registered in JSONPath
configuration.
See gh-10, see gh-317
As these are expected to be used as local variables, "Spec" reduces
readability and the IDE creates variables called "spec", which
increases that effect. Given those are nested within `GraphQlClient`
and `GraphQlTester`, it makes sense to drop the spec part and local
variable names such as request and response make sense.
See gh-10, see gh-317
Extract GraphQlRequest, as a parent of RequestInput, that holds the
actual request inputs sent from the client side. RequestInput then
adds server-side transport details and ExecutionInput support.
Also replace "query" with "document" in GraphQlRequest and in
GraphQlClient.
Closes gh-310
WebOutput now exposes the ExecutionInput prepared for the request and
no longer provides access to the WebInput which is already available
to a WebInterceptor.
Closes gh-229
Prior to this commit, the `WebInput` would hold an `id` attribute that
correlate the request and response messages on a multiplexed connection.
This commit moves this concept directly to the `RequestInput` so that it
can be used as an `ExecutionId` for all types of transports, if
availble.
This id was already set on the `WebInput` in the WebFlux case with the
id coming from the exchange, but it also creates an id and set it for
the MVC case. This id is then propagated to GraphQL's `ExecutionInput`.
See gh-183