918 Commits

Author SHA1 Message Date
Brian Clozel
45799fd3e5 Upgrade to GraphQL Java 19.11
Closes gh-935
2024-03-28 09:24:32 +01:00
rstoyanchev
6651ecbbc0 Add section on code generation
Closes gh-848
2023-12-07 10:13:04 +00:00
Brian Clozel
39fa0355a3 Fix JDK version script in CI pipeline 2023-11-21 11:37:45 +01:00
Brian Clozel
bdaeb875e4 Upgrade CI pipeline 2023-11-21 10:19:53 +01:00
Brian Clozel
cb2f4b2db5 Fix GraalVM reflection metadata for GraphQL client
Prior to this commit, the embedded reachability metadata for GraalVM
would declare a reflection hint for `GraphQlWebSocketMessage` when the
RSocket or WebSocket clients are reachable.
The `CodecDelegate` relies on this message class to test codecs and
detect a JSON-capable instance. This is true for all supported
GraphQlClient implementations.

This commit revisits the embedded reachability metadata to:

* allow reflection on `GraphQlWebSocketMessage` if any client extending
  `AbstractGraphQlClientBuilder` is available
* allow reflection on `GraphQlWebSocketMessage` if a
  `GraphQlWebSocketHandler` is reachable

Fixes gh-837
2023-10-13 23:18:25 +02:00
Spring Builds
432c51740d Next development version (v1.1.8-SNAPSHOT) 2023-09-19 15:23:17 +00:00
Koen Punt
a3db3fd514 Correctly retrieve operation from request body
Backport of e74240 and 5be2d8.

Closes gh-818
2023-09-19 15:04:59 +01:00
Spring Builds
c9e0d53300 Next development version (v1.1.7-SNAPSHOT) 2023-09-19 08:26:42 +00:00
Brian Clozel
4e67f5dadd Upgrade to Context Propagation 1.0.5
Closes gh-808
2023-09-16 23:12:32 +02:00
Brian Clozel
746b67a451 Upgrade to Spring Security 6.0.6
Closes gh-807
2023-09-16 23:12:02 +02:00
Brian Clozel
df03b9034e Upgrade to Spring Data 2022.0.1
Closes gh-806
2023-09-16 23:11:26 +02:00
Brian Clozel
f978f41b0b Upgrade to Micrometer 1.10.11 and Tracing 1.0.10
Closes gh-805
2023-09-16 23:10:43 +02:00
Brian Clozel
520955802e Upgrade to Reactor 2022.0.11
Closes gh-804
2023-09-16 23:09:54 +02:00
Brian Clozel
ed8089f8cb Upgrade to GraphQL Java 19.8
Closes gh-803
2023-09-16 23:08:15 +02:00
Brian Clozel
28a5208a69 Upgrade to Spring Framework 6.0.12
Closes gh-802
2023-09-16 23:07:21 +02:00
Brian Clozel
364f0b9fd2 Upgrade CI image to JDK 17.0.8 2023-09-16 22:10:05 +02:00
Brian Clozel
1a78aea3a0 Upgrade CI image to ubuntu:jammy-20230816 2023-09-16 22:08:15 +02:00
rstoyanchev
cd35c835e1 Add section on file uploads
Backport of 142ca8

Closes gh-749
2023-09-14 14:12:37 +01:00
rstoyanchev
372feab856 Refactoring in DefaultBatchLoaderRegistry
Closes gh-789
2023-09-01 11:28:14 +01:00
Brian Clozel
9b61d2808e Do not rewrap CompletionException in DataFetcher instrumentation
This commit ensures that, when an instrumented DataFetcher returns a
`CompletionException`, we do not re-wrap it with the same exception
type. This aligns with the behavior enforced in the JDK
`CompletableFuture`.

Fixes gh-784
2023-08-28 12:27:49 +02:00
Brian Clozel
c8d1f7c4e2 Upgrade to Gradle 8.3 and Gradle plugins
This commit upgrades the build to:

* Gradle 8.3
* Gradle Spring conventions 0.0.14
* Gradle Enterprise plugin 3.12.6
2023-08-18 11:44:09 +02:00
Brian Clozel
ae5b7e7cb0 Set current observation in data fetching environment
Prior to this commit, the Observability instrumentation would instrument
`DataFetcher` instances and set the current observation in the local
context of the value returned by the data fetcher itself.
This allowed to properly build a parent/child chain of observations
between the main request and the instrumented data fetching
observations.

Because the current observation was not set in the
`DataFetchingEnvironment` given as a parameter to the data fetcher, any
operation done in the data fetcher would not propagate using the current
observation but instead the parent one.

This commit revisits the implementation of the instrumentation to not
wrap the result anymore, but to build a new local `GraphQLContext` that
holds the current observation right before calling the data fetcher.
Note that we cannot "just" set the current observation in that local
context as this is shared mutable instance for all child data fetchers.

Fixes gh-764
2023-08-17 18:22:13 +02:00
Brian Clozel
c5f1e5f4de Add test case for gh-774
This commit also ensures that a new local context is created, copying
the existing values. This avoids mutating the parent local context and
polluting it with local values.
This could cause unintended side effects on other child datafetchers.

Fixes gh-774
2023-08-16 20:49:58 +02:00
Koen Punt
8131c7e88f Inherit local context from environment in instrumentation
Prior to this commit, a `DataFetcher` instrumented by the
`GraphQlObservationInstrumentation` would incorrectly overwrite the
local context when:

* the `DataFetcher` returns a value object (i.e. not a
  `DataFetcherResult`)
* the given `DatFetchingEnvironment` has an existing local context
with values

For this case, the instrumentation would create a new local context but
would not inherit from the existing local context.

See gh-774
2023-08-16 20:22:29 +02:00
Spring Builds
8f91e7ccc4 Next development version (v1.1.6-SNAPSHOT) 2023-06-20 08:30:23 +00:00
rstoyanchev
d1975ff422 Enhance request body check
Closes gh-733
2023-06-20 08:03:14 +01:00
Brian Clozel
0182e72fde Upgrade to Context Propagation 1.0.3
Closes gh-718
2023-06-19 21:16:07 +02:00
Brian Clozel
2d54d77ff6 Upgrade build to Spring Boot 3.0.7 2023-06-19 20:56:28 +02:00
Brian Clozel
2f52fefc79 Upgrade to Spring Framework 6.0.10
Closes gh-730
2023-06-19 20:55:59 +02:00
Brian Clozel
a03a79c887 Upgrade to GraphQL Java 19.6
Closes gh-729
2023-06-19 20:55:10 +02:00
Brian Clozel
32931f350d Upgrade to Spring Data 2022.0.7
Closes gh-732
2023-06-19 20:54:11 +02:00
Brian Clozel
e7410edda6 Upgrade to Micrometer 1.10.8 and Tracing 1.0.7
Closes gh-731
2023-06-19 20:52:42 +02:00
Brian Clozel
49bd405098 Upgrade to Reactor 2022.0.8
Closes gh-720
2023-06-19 20:47:48 +02:00
rstoyanchev
c8a8fb2b83 Drop deprecated method in ExceptionResolversExceptionHandler
Closes gh-711
2023-06-16 11:39:16 +01:00
Brian Clozel
10528388dc Start building against Reactor 2022.0.8 SNAPSHOTs
See gh-720
2023-06-07 16:19:00 +02:00
Brian Clozel
48c16267e8 Upgrade to Context Propagation 1.0.3
Closes gh-716
Closes gh-718
2023-06-07 16:13:42 +02:00
Spring Builds
c944d9bbb4 Next development version (v1.1.5-SNAPSHOT) 2023-05-16 11:32:11 +00:00
Brian Clozel
ebe5706cda Upgrade to Jackson 2.14.3 2023-05-15 14:30:23 +02:00
Brian Clozel
ddf2ac83ac Upgrade to Micrometer 1.10.7
Closes gh-700
2023-05-15 14:29:34 +02:00
Brian Clozel
d106af5ad1 Upgrade to Reactor 2022.0.7
Closes gh-699
2023-05-15 14:28:38 +02:00
Brian Clozel
4616d0fde3 Upgrade to Spring Security 6.0.3
Closes gh-698
2023-05-15 14:27:05 +02:00
Brian Clozel
968b8e6673 Upgrade to Spring Data 2022.0.6
Closes gh-697
2023-05-15 14:26:16 +02:00
Brian Clozel
66fd6b05db Upgrade to Spring Boot 3.0.6 2023-05-15 14:24:53 +02:00
Brian Clozel
51cf46657d Upgrade to GraphQL Java 19.5
Closes gh-696
2023-05-15 14:24:23 +02:00
Brian Clozel
cec3555687 Upgrade to Spring Framework 6.0.9
Closes gh-695
2023-05-15 14:22:34 +02:00
Brian Clozel
faea9d1c8b Fix observability instrumentation for CompletionStage
This commit fixes the observability instrumentation for data fetchers
when the return type is of `CompletionStage`. Prior to this commit, the
instrumentation of `CompletionStage` return values as
`DataFetcherResult` would wrap the asynchronous value twice.

Closes gh-676
2023-05-11 14:44:32 +02:00
Brian Clozel
0a41104226 Use localContext for storing data fetcher observations
Prior to this commit, a partial fix in a56ff6e introduced proper
relationships between request and data fetcher observations by tracking
them in a local concurrent map. This fix is incomplete as data fetcher
operations are not set as current in the ThreadLocal or reactive
contexts when the actual DataFetcher is executed.

We cannot use the global GraphQLContext for DataFetcher observations,
as it is shared for the entire GraphQL request (and no thread safe).

This commit makes the Instrumentation instrument DataFetcher and make
them return a `DataFetcherResult` that holds a
`g.s.DataFetchingEnvironment#getLocalContext` with a reference to the
current data fetcher observation. A temporary fix is also applied in
`ContextDataFetcherDecorator` to merge both global and local contexts
when capturing a `ContextSnapshot` to be applied for the data fetching
operation.

Fixes gh-676
See gh-688
2023-05-10 14:50:45 +02:00
Brian Clozel
a56ff6e58d Fix DataFetcher observations hierarchy
Prior to this commit, the `GraphQlObservationInstrumentation` would
organize the parent/child relationship between data fetcher observations
by setting the current observation under a well-known key in the global
GraphQL context.

In some cases, the order of execution and the scheduling of operations
does not reflect the actual operation hierarchy as defined by the
GraphQL `ExecutionStepInfo`. This would result in traces where data
fetching operations are set with incorrect parent/child relationships.

This commit ensures that data fetcher observations have their parent set
with the expected one, by keeping track of active observations and using
the `ExecutionStepInfo` path as a key.

Fixes gh-676
2023-04-24 22:51:24 +02:00
Brian Clozel
4e5aaeddab Revisit request observation context type
Prior to this commit, the request execution observation would have a
context of type `RequestReplyReceiverContext` to directly deal with
tracing propagation at the transport level. This approach doesn't work
anymore as the parent observation is not properly set on the resulting
trace, even if it is manually set in the instrumentation.

This commit revisits the request observation setup and turns its context
into a regular `Observation.Context`. Tracing propagation should be
dealt with directly at the transport level by an underlying observation.
This is the case already for Spring Framework HTTP server observations.

As a result, the `PropagationWebGraphQlInterceptor` is deprecated with
no replacement and should not be used anymore.

Fixes gh-675
2023-04-24 22:03:34 +02:00
rstoyanchev
c650db895b Add link in documentation to Apollo federation sample
Closes gh-384
2023-04-14 08:27:17 +01:00