Commit Graph

530 Commits

Author SHA1 Message Date
Mark Paluch
4653e94976 Remove raw-type cast in QuerydslDataFetcher
No longer required as Spring Data accepts MultiMap's containing object values.

Closes gh-311
2022-03-16 14:49:16 +01:00
Brian Clozel
22c1472bcc Fix CI pipeline configuration
See gh-331
2022-03-16 14:38:02 +01:00
Brian Clozel
0cf2ce023d Use Concourse Release Script as Docker image in CI
Instead of embeddeding the Concourse Release Scripts application as a
JAR in the CI image, this commit is now using the published Docker image
for this.
2022-03-16 14:26:53 +01:00
Brian Clozel
2b6dd8f1e1 Generate CHANGELOG during release promotion
Closes gh-331
2022-03-16 14:26:24 +01:00
Brian Clozel
d847211d0f Upgrade to Gradle 7.4.1 2022-03-16 14:26:00 +01:00
Brian Clozel
f197e2606d Add SDKMAN! file for JDK env selection
Closes gh-330
2022-03-16 14:25:21 +01:00
Brian Clozel
0346474357 Upgrade to ubuntu:focal-20220302 in CI image 2022-03-16 13:53:39 +01:00
Brian Clozel
4d3c349e34 Upgrade JDK versions in CI image 2022-03-16 13:52:56 +01:00
rstoyanchev
4d115c01cc Upgrade dependencies
GraphQL Java 18.0
Reactor 2020.0.17
Spring Framework, Spring Data, Spring Security snapshots
2022-03-16 10:00:37 +00:00
rstoyanchev
0967a6e7b7 Update documentation for GraphQlClient
See gh-10
2022-03-15 09:00:28 +00:00
rstoyanchev
e7b2f72d55 Add RetrieveSpec to GraphQlClient
Provides a shortcut alternative to the execute methods, for decoding
a single field from the response.

See gh-10
2022-03-15 09:00:28 +00:00
rstoyanchev
38a9eb1b3c Align client with GraphQL Java error paths
DefaultClientGraphQlResponse now parses the path to a field and creates
the same parsed representation as GraphQL Java does and uses for
GraphQLError paths. This makes it easier to correlate fields to field
errors and eliminates the need for a dependency on JSONPath in the
client.

See gh-10
2022-03-15 09:00:28 +00:00
rstoyanchev
3214a9cfc9 Introduce GraphQlClientException hierarchy
Refine exception handling and ensure a hierarchy of exceptions that
allows differentiating between transport errors vs field errors while
accessing an invalid data or field.

See gh-10
2022-03-15 09:00:28 +00:00
rstoyanchev
eb3c8d1a7e Refine status code in WebSocket client transport
See gh-10
2022-03-15 09:00:28 +00:00
rstoyanchev
dcb752dde4 Introduce ClientGraphQlResponse
Extends GraphQlResponse with a subtype that exposes further options to
handle data and errors in the response from a client perspective.

See gh-10
2022-03-15 09:00:28 +00:00
rstoyanchev
15238072bb Introduce GraphQlResponse
Replace the use of ExecutionResult on the client side where we are
dealing with a response map rather, and also incorporate it into the
server-side hierarchy where it wraps an ExecutionResult instead.

See gh-10
2022-03-15 09:00:28 +00:00
Brian Clozel
77e9835d3a Fix typo in reference documentation 2022-03-10 11:11:31 +01:00
Brian Clozel
83d26467e7 Document why Jackson annotations are not used
This commit explains why Jackson annotations have no impact on the
serialization/deserialization process. Instead applications should
describe and coerce types using scalars.

Fixes gh-321
2022-03-10 11:10:09 +01:00
rstoyanchev
1e652f800b Polishing 2022-03-10 09:48:37 +00:00
rstoyanchev
fb521e9b6f Add section on GraphQlClient to the reference docs
See gh-10
2022-03-10 09:48:14 +00:00
rstoyanchev
f568bce8a5 Correctly bind nested empty list
Closes gh-301
2022-03-09 21:24:31 +00:00
rstoyanchev
f42563424e Do not create "error" message from ExecutionResult
Fix gh-320
2022-03-09 12:47:26 +00:00
rstoyanchev
f6b9fdfe7c Fix issue with matchesJson when JSONPath is a String
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.
2022-03-09 12:47:26 +00:00
rstoyanchev
4818ee6c81 Upgrade samples to match the GraphQlTest updates
See gh-310
2022-03-09 12:47:26 +00:00
rstoyanchev
19793a6e74 Revert "Pin version to 1.0.0-M5 in samples"
This reverts commit b40375f1f2.
2022-03-09 08:57:10 +00:00
rstoyanchev
71881f5e47 Expose convenience String url methods
See gh-317
2022-03-09 08:49:56 +00:00
rstoyanchev
7459637808 Revise GraphQlTester documentation
Closes gh-317
2022-03-09 08:49:34 +00:00
rstoyanchev
caa717e358 Move repo.spring.io up in the order
I'm getting very slow times on failures to resolve Boot snapshots
through the gradlePluginPortal (3-4 min build time). Moving it down
after repo.spring.io restores regular build times.
2022-03-08 17:21:38 +00:00
rstoyanchev
c9640b6134 Respond to GraphQL over WebSocket "ping" type messages
Closes gh-270
2022-03-08 16:44:03 +00:00
rstoyanchev
878c643672 Refactor GraphQlMessage and add GraphQlMessageType enum
See gh-270
2022-03-08 12:50:32 +00:00
rstoyanchev
ec00547130 Add handleConnectionClosed to WebSocketInterceptor
Closes gh-276
2022-03-08 08:51:20 +00:00
rstoyanchev
35359b0b24 Add sessionId to WebSocketInterceptor callbacks
See gh-276
2022-03-08 08:51:10 +00:00
Brian Clozel
c6d10d3ab8 Check for missing errors in GraphQlTester#executeAndVerify
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
2022-03-07 22:42:36 +01:00
rstoyanchev
b40375f1f2 Pin version to 1.0.0-M5 in samples
This is necessary until Boot catches up with spring-graphql snapshots.
2022-03-07 10:39:59 +00:00
rstoyanchev
5d4065e70b Correct handling of complete WebSocket message
This `handleConnectionCompletion` method on `WebSocketInterceptor`
method handles the `complete` GraphQL over WebSocket message which is
defined as canceling an individual subscription stream. The method was
incorrectly modeled as a notification for the closing of the whole
connection.

The method has been renamed, Javadoc clarified, and the subscription
id passed in.

See gh-276
2022-03-07 10:39:59 +00:00
rstoyanchev
6b61ec3e74 Simplify access to WebSocketInterceptor
WebGraphQlHandler is no longer aware of individual callbacks on
WebSocketInterceptor and instead provides a method to return the
interceptor. This allows the WebSocket handlers for WebFlux and WebMvc
to call the interceptor directly.

See gh-276
2022-03-07 10:39:59 +00:00
rstoyanchev
1559c5989e Adapt CodecConfigurer to JSONPath MappingProvider
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
2022-03-07 10:39:59 +00:00
rstoyanchev
abb51ee5e2 Refactoring in testFixtures 2022-03-07 10:39:59 +00:00
rstoyanchev
50c71d03fc Move TestWebSocketClient to testFixtures 2022-03-07 10:39:59 +00:00
rstoyanchev
d063eb760a Simplify filtered error handling in GraphQlTester
See gh-317
2022-03-07 10:39:59 +00:00
rstoyanchev
6480ab7e9f Polishing in GraphQlClient and GraphQlTester
See gh-10, see gh-317
2022-03-07 10:39:59 +00:00
rstoyanchev
e67cb5885e Rename ~Spec in GraphQlClient and GraphQlTester
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
2022-03-07 10:39:59 +00:00
rstoyanchev
53fb1d4dc0 Update and expand GraphQlTester tests
See gh-317
2022-03-07 10:39:59 +00:00
rstoyanchev
29b1aa2cc7 Introduce transport specific GraphQlTester extensions
See gh-317
2022-03-07 10:39:59 +00:00
rstoyanchev
1ae7eb742f Replace RequestStrategy with GraphQlTransport hierarchy
See gh-317
2022-03-07 10:39:59 +00:00
rstoyanchev
9318eade52 Update and expand GraphQlClient tests
See gh-10
2022-03-07 10:39:59 +00:00
rstoyanchev
d7f5e44ad6 Simplify GraphQlClient hierarchy and implementations
Add WebGraphQlClient as a common representation for a Web GraphQlClient
extension and its builders that has to be started through the HTTP or
WebSocket implementations.

Remove the common base builder for HTTP and WebSocket, with HTTP simply
delegating to the underlying WebClient builder For WebSocket, builder
state is exposed from the transport to simplify the mutation logic.

DefaultGraphQlClientBuilder is now abstract, leaving subclasses to
implement the build method.

See gh-10
2022-03-07 10:39:59 +00:00
rstoyanchev
347f51941a Make transports private and drop builders
Now that transport specific GraphQlClient extensions provide a unified
builder for GraphQlClient and transport configuration, the transports
become a private implementation detail.

See gh-10
2022-03-07 10:39:59 +00:00
rstoyanchev
5a73e05040 Add transport specific GraphQlClient extensions
Add HttpGraphQlClient and WebSocketGraphQlClient extensions along with
a builder hierarchy that combines GraphQlClient and transport specific
configuration.

See gh-10
2022-03-07 10:39:59 +00:00
rstoyanchev
328d5c2b3e DocumentSource is async and supports caching
See gh-10
2022-03-07 10:39:59 +00:00