Commit Graph

1479 Commits

Author SHA1 Message Date
Brian Clozel
285dcda3f5 Remove deprecated code
Closes gh-1151
2025-03-12 21:13:14 +01:00
Brian Clozel
0d4fe150aa Remove test log reporting in build output 2025-03-12 17:28:55 +01:00
Brian Clozel
6d471cd7b8 Add TimeoutWebGraphQlInterceptor
This commit adds a new web interceptor that can be configured with a
specific duration. If the response is not produced within this timeline,
the interceptor sends a HTTP error status to the client (by default,
"REQUEST TIMEOUT" but this can be configured) and sends a CANCEL signal
upstream.
This CANCEL signal flows up to controller methods and maually registered
data fetchers, if they have a reactive return type. Processing will be
automatically aborted.
For other types of date fetchers, applications can retrieve a publisher
from the GraphQL context and get notified of cancellations.

Closes gh-450
2025-03-12 17:00:18 +01:00
rstoyanchev
0df247fa38 Merge branch '1.3.x' 2025-03-11 18:23:17 +00:00
rstoyanchev
f3f5516b8a ContextDataFetcherDecorator support for DataFetcherResult
Closes gh-1143
2025-03-11 18:21:06 +00:00
rstoyanchev
008a78d1c5 Handle invalid media types as client errors
Closes gh-1145
2025-03-11 18:14:26 +00:00
rstoyanchev
bd8a633eac AbstractGraphQlTesterBuilder copies extensions/attributes
Closes gh-1135
2025-03-11 18:14:26 +00:00
rstoyanchev
5682740dee GraphQlTester provides access to underlying response
Closes gh-1131
2025-03-11 18:14:26 +00:00
Brian Clozel
6956523892 Merge branch '1.3.x' 2025-03-11 10:37:02 +01:00
Brian Clozel
5c2164c5f2 Propagate cancel signal from transport to data fetchers
Prior to this commit, a WebSocket/SSE client disconnecting from the data
stream would cause a CANCEL signal to be sent to upstream publishers.
This signal would flow from the transport layer up to the
`ExecutionGraphQlService`. Because the `GraphQL` engine itself relies on
`CompletableFuture`, the CANCEL signal would not flow through and
reactive data fetchers would not receive it. This means that costly
reactive operations would not be cancelled and this could cause write
failures as publishers would still produce values.

This commit adds at the service level a Reactor `Sink` to the
`GraphQLContext` that can be picked up by the
`ContextDataFetcherDecorator` when decorating reactive data fetchers.
This allows us to manually cancel publishers when the CANCEL signal is
received at the transport level.

Fixes gh-1149
2025-03-11 10:31:53 +01:00
Brian Clozel
f1f352b07c Add project icon for IntelliJ IDEA 2025-02-28 18:36:59 +01:00
Brian Clozel
4f0a72ddcb Merge branch '1.3.x' 2025-02-28 14:24:56 +01:00
Brian Clozel
929430065c Upgrade to Gradle 8.13 2025-02-28 14:24:39 +01:00
rstoyanchev
b0862fbaf4 Polishing in FederationSchemaFactory
See gh-1088
2025-02-20 11:52:51 +00:00
rstoyanchev
2f1c4b1b99 FederationSchemaFactory checks for unmapped entities
Closes gh-1088
2025-02-20 11:25:24 +00:00
rstoyanchev
310424e793 SchemaMappingInspector checks public fields
Closes gh-1101
2025-02-20 11:25:24 +00:00
Brian Clozel
4a5aaf182d Merge branch '1.3.x' 2025-02-18 11:29:12 +01:00
Brian Clozel
c3de464dc9 Next development version (v1.3.5-SNAPSHOT) 2025-02-18 11:28:15 +01:00
Brian Clozel
5b999680ab Merge branch '1.3.x' 2025-02-18 10:10:54 +01:00
Brian Clozel
693db4374a Upgrade to Spring Security 6.3.6
Closes gh-1130
2025-02-18 10:10:27 +01:00
Brian Clozel
5ea02fd471 Upgrade to Spring Data 2024.0.9
Closes gh-1129
2025-02-18 10:10:08 +01:00
Brian Clozel
86d094ead5 Upgrade to Micrometer 1.13.11
Closes gh-1128
2025-02-18 10:09:40 +01:00
Brian Clozel
373fda5c85 Upgrade to Reactor 2023.0.15
Closes gh-1127
2025-02-18 10:08:58 +01:00
Brian Clozel
50546c1d03 Upgrade to Spring Framework 6.1.17
Closes gh-1126
2025-02-18 09:30:23 +01:00
Brian Clozel
a172ac9512 Update gitignore to allow for "build" GitHub actions 2025-02-17 16:29:57 +01:00
rstoyanchev
914b958d2c Merge branch '1.3.x' 2025-02-17 15:21:17 +00:00
rstoyanchev
6120c31706 Case-insensitive lookup of bearer auth token
Closes gh-1116
2025-02-17 15:21:00 +00:00
rstoyanchev
36d76a4cd1 Merge branch '1.3.x' 2025-02-17 12:49:58 +00:00
rstoyanchev
3360e4a46e Log unhandled exceptions in WebSocket handlers
Closes gh-1122
2025-02-17 12:49:18 +00:00
Mark Paluch
8dce170a12 Update annotation processor documentation for Querydsl.
Reflect jakarta classifiers for Querydsl annotation processing. Also, update to Java 22+ conventions requiring annotation processor paths instead of relying on annotation processors present in dependencies.

Closes gh-1121
2025-02-17 11:57:59 +01:00
Brian Clozel
c5fef9b4ab Document GraphQL over HTTP spec support
This commit concludes the support for the "GraphQL over HTTP" spec, with
both clients and servers complying with the expected behavior for the
"application/graphql-response+json" response media type.

Closes gh-1117
2025-02-13 17:38:13 +01:00
Brian Clozel
5d615eb5cd Update config flag for legacy HTTP behavior
This commit renames and changes the behavior of the configuration option
on `GraphQlHttpHandler` implementations. The
`setHttpOkOnValidationErrors` option is `false` by default and is
introduced as a deprecated method right away. Our goal here is to fade
out this option as soon as possible the traditional behavior for
"application/graphql-response+json" media types.

See gh-1117
2025-02-13 16:52:23 +01:00
rstoyanchev
803df55188 Merge branch '1.3.x' 2025-02-12 16:25:16 +00:00
Brian Clozel
99594c4ca6 Adapt HTTP GraphQlClient to GraphQL over HTTP spec
This commit adapts the GraphQlClient HTTP transports (async and sync) to
accept 4xx responses if the response content type is
"application/graphql-response+json".

This allows the client to support the "GraphQL over HTTP" specification.
This commit adds a new test suite to check compatibility against this
spec.

See gh-1117
2025-02-12 16:46:28 +01:00
rstoyanchev
db7804375e Improve ErrorClassification deserialization
Closes gh-1115
2025-02-12 15:32:59 +00:00
rstoyanchev
b977beffa3 Polishing 2025-02-12 15:15:28 +00:00
Mingyuan Wu
dd1a6933dd Polish
Closes gh-1120
Signed-off-by: Mingyuan Wu <my.wu@outlook.com>
2025-02-11 21:51:09 +01:00
Brian Clozel
00c53ecc62 Merge branch '1.3.x' 2025-02-11 21:40:40 +01:00
Brian Clozel
ba05a3f321 Upgrade Gradle setup
Upgrade Gradle setup in CI and Gradle to 8.12.1
2025-02-11 21:40:07 +01:00
Brian Clozel
feb7ce3831 Remove manual develocity config
This should have been removed when we upgraded to
"io.spring.develocity.conventions:0.0.22".
I suspect this is the reason we are not getting build scan URLs in
GitHub action runs anymore.
2025-02-05 11:47:05 +01:00
Brian Clozel
0948e61509 Merge branch '1.3.x' 2025-02-05 10:28:11 +01:00
Brian Clozel
af74edbcc7 Handle early GraphQLExceptions in ExecutionGraphQlService
Prior to this commit, the `ExecutionGraphQlService` would throw
`GrahphQLException` instances if errors happen early in the process, for
example in some cases of document parsing/validation.

Such exception would be thrown directly and not reflected in the GraphQL
response if those are `GraphQLError`.

This commit ensures that a fallback GraphQL response is created in this
case and that it contains the relevant `GraphQLError` information.

Fixes gh-1118
2025-02-05 10:24:43 +01:00
Brian Clozel
16aa33a2fb Align server transports with GraphQL/HTTP spec
Prior to this commit, the `GraphQlHttpHandler` implementations for MVC
and WebFlux would support the HTTP transport protocol for servers.
They would align with the well-known GraphQL behavior, using HTTP as a
transport and always using HTTP 200 OK as response status.

The new GraphQL over HTTP specification changes that, and requires
servers to respond with HTTP 4xx/5xx statuses when an error occurs
before the GraphQL request execution: for example, if the JSON document
cannot be parsed, or the GraphQL document is invalid.

This commit introduces a new "standard mode" option on HTTP transports
to follow this new requirement. Because this is a breaking change for
GraphQL clients, this mode is opt-in only for now.

See gh-1117
2025-02-05 10:17:22 +01:00
Brian Clozel
c015dbcb15 Add GraphQL response media type
This commit introduces a static `MediaType` instance for
`"application/graphql-response+json"`.

Closes gh-1110
2025-02-04 21:38:48 +01:00
rstoyanchev
c1938fc24d Merge branch '1.3.x' 2025-01-30 15:13:29 +00:00
rstoyanchev
474fbcafa1 Handler failure from GraphQlExceptionHandler method
Closes gh-1090
2025-01-30 15:11:48 +00:00
rstoyanchev
d2002bbe84 Handle early closure of WebSocket connection
Ensure the error is routed to the graphQlSessionSink when the WebSocket
connection is closed before the GraphQLSession is initialized.

Closes gh-1098
2025-01-30 15:09:58 +00:00
Brian Clozel
36bfd40d66 Remove usages of Framework's MediaType.APPLICATION_GRAPHQL
Closes gh-1109
2025-01-13 11:47:09 +01:00
Stéphane Nicoll
ff0528611e Add release milestone workflow
This commit adds a dedicated workflow to release a milestone, and
publish the changelog with a "pre-release" flag accordingly.

Closes gh-1025
2025-01-13 11:15:14 +01:00
Brian Clozel
6f422a9294 Merge branch '1.3.x' 2025-01-13 11:14:02 +01:00