Commit Graph

1086 Commits

Author SHA1 Message Date
Brian Clozel
e489203523 Upgrade to Reactor 2022.0.11
Closes gh-811
2023-09-17 17:52:24 +02:00
Brian Clozel
bfbf4cf9f8 Upgrade to GraphQL Java 20.6
Closes gh-810
2023-09-17 17:51:16 +02:00
Brian Clozel
111d05d216 Upgrade to Spring Framework 6.0.12
Closes gh-809
2023-09-17 17:50:37 +02:00
Brian Clozel
e14bfa1959 Upgrade CI image to Java 17.0.8 2023-09-17 17:48:46 +02:00
Brian Clozel
8ac3b3784b Upgrade CI image to Ubuntu jammy-20230816 2023-09-17 17:48:14 +02:00
rstoyanchev
fcb11a4ee7 Fix test failures
Adjust tests with Principal to express nullability or
to provide it. In addition, Mono should not be treated
as a required parameter.

Closes gh-790
2023-09-14 20:06:58 +01:00
rstoyanchev
a960132179 Polishing contribution
See gh-790
2023-09-14 20:06:58 +01:00
Koen Punt
c2443326eb Raise exception if Principal is required but not present
See gh-790
2023-09-14 20:06:58 +01:00
rstoyanchev
ab392461ab Polishing contribution
Closes gh-653
2023-09-14 15:03:33 +01:00
Koen Punt
e7d72534e7 Support use of dataloader from suspend function
Rudimentary implementation to support returning a `CompletableFuture`
from a suspend function.

`CoroutinesUtils.invokeSuspendingFunction` wraps the return value of
the function in a `Mono` (or `Flux`). But it also does this when a
`CompletableFuture` is returned, and thus results in a
`Mono<CompletableFuture<?>>`, which isn't captured by graphql-java,
and thus the dataloader is never dispatched.

By unwrapping the future, and _converting_ it to a mono (as opposed
to wrapping), the dataloader is dispatched correctly.

See gh-653
2023-09-14 15:03:33 +01:00
rstoyanchev
71b1f5868b Fix IndexOutOfBoundsException for empty Window
Closes gh-775
2023-09-01 16:38:35 +01:00
rstoyanchev
a079d442c8 Polishing
See gh-788
2023-09-01 10:18:50 +01:00
rstoyanchev
2539d95f27 Refactoring in DefaultBatchLoaderRegistry
Closes gh-788
2023-08-31 18:09:30 +01:00
Brian Clozel
32ed3e967e 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-780
2023-08-28 12:25:38 +02:00
Brian Clozel
1032f99b6d Polish
See gh-759
2023-08-21 17:43:40 +02:00
roksui
8038be2796 Change WebGraphQlServiceTester to WebGraphQlTester
Closes gh-759
2023-08-21 17:09:01 +02:00
roksui
b200ec9eca Fix typo in README.md 2023-08-21 17:07:53 +02:00
Brian Clozel
89d5b7e9df Support CSRF protection in GraphiQL with cookie-to-header strategy
Prior to this commit, secured applications with CSRF protection could
not easily use the GraphiQL integration shipped with Spring for GraphQL,
as the JavaScript code would not work with any CSRF protection strategy
for single page apps.

This commit checks whether the main HTTP response contains a
`XSRF-TOKEN` Cookie value, and uses it as a `X-XSRF-TOKEN` request
header for the next AJAX request to the `/graphql` endpoint.

Note that a specific configuration must be set in Spring Security to
achieve that:
* the CSRF token must be sent as a response Cookie for the initial
  authenticated request
* if the application is protected against BREACH, all new token values
  must be sent as response cookies as well and a request handler must be
  configured

Closes gh-758
2023-08-18 20:51:26 +02:00
Brian Clozel
bb819f9327 Add GraphiQL Explorer plugin in embedded integration
Closes gh-777
2023-08-18 20:50:47 +02:00
Brian Clozel
130e08f109 Upgrade to React 18 in GraphiQL embedded integration
Closes gh-776
2023-08-18 20:48:36 +02:00
Brian Clozel
df5748cc5e Update links to reference docs in README 2023-08-18 14:47:04 +02:00
Siva Kumar Edupuganti
f406e63e78 Added getting support links
Closes gh-621
2023-08-18 14:44:34 +02:00
Brian Clozel
95f40e750b 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:39:06 +02:00
Brian Clozel
94e9a8d2d7 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-757
2023-08-17 18:21:41 +02:00
Brian Clozel
94ba9fed8f Add test case for gh-761
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-761
2023-08-16 20:18:09 +02:00
Koen Punt
58bd58bef0 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-761
2023-08-16 20:18:05 +02:00
Rob Winch
29fb3293f2 Fix include-code macro 2023-08-04 15:38:28 +01:00
Rob Winch
9a4b72935d Convert to Asciidoctor Tabs 2023-08-04 15:38:28 +01:00
Rob Winch
91feee745e use latest antora 2023-08-04 15:38:28 +01:00
Rob Winch
327a3588bc remove h2 from index.adoc 2023-08-04 15:38:28 +01:00
Rob Winch
d485fdf85b No warnings 2023-08-04 15:38:28 +01:00
Rob Winch
bb9aaaddc8 fix it 2023-08-04 15:38:28 +01:00
Rob Winch
6901f41c33 Fix cross references 2023-08-04 15:38:28 +01:00
Rob Winch
78508c4b18 Remove includes 2023-08-04 15:38:28 +01:00
Rob Winch
d4e75f1921 Generate a default navigation 2023-08-04 15:38:28 +01:00
Rob Winch
359f925a00 Copy default antora files 2023-08-04 15:38:28 +01:00
Rob Winch
295e725985 Remove unnecessary asciidoc attributes 2023-08-04 15:38:28 +01:00
Rob Winch
d628d22b3f Insert explicit ids for headers 2023-08-04 15:38:28 +01:00
Rob Winch
49446b7171 Migrate Structure 2023-08-04 15:38:28 +01:00
Spring Builds
edda403220 Next development version (v1.2.3-SNAPSHOT) 2023-07-18 14:33:56 +00:00
rstoyanchev
142ca8cd73 Add section on file uploads
Closes gh-747
2023-07-18 15:07:25 +01:00
rstoyanchev
db525f18f4 Fix incorrect nesting under Transports section 2023-07-18 12:42:18 +01:00
rstoyanchev
74e8c60b4e Support coroutine @GraphQlExceptionHandler methods
Closes gh-750
2023-07-18 12:18:31 +01:00
Brian Clozel
fdb7051ae3 Upgrade optional dependencies 2023-07-17 17:40:54 +02:00
Brian Clozel
ac2dd9ba72 Upgrade to Context Propagation 1.0.4
Closes gh-756
2023-07-17 17:40:32 +02:00
Brian Clozel
c1da2a309f Upgrade to RSocket 1.1.4
Closes gh-755
2023-07-17 17:36:02 +02:00
Brian Clozel
394f08bcf4 Upgrade to Spring Security 6.1.1
Closes gh-754
2023-07-17 17:35:24 +02:00
Brian Clozel
7bddba37f0 Upgrade to Spring Data 2023.0.2
Closes gh-753
2023-07-17 17:34:38 +02:00
Brian Clozel
a07dc73c9c Upgrade to Micrometer 1.11.2 and Tracing 1.1.2
Closes gh-752
2023-07-17 17:22:53 +02:00
Brian Clozel
98cba54a53 Upgrade to Reactor 2022.0.9
Closes gh-751
2023-07-17 17:21:38 +02:00