Commit Graph

806 Commits

Author SHA1 Message Date
rstoyanchev
c43c0bec2e Polishing
Closes gh-559
2022-12-06 15:39:35 +00:00
Mark Paluch
ca0d0b46f9 Add builder customizers for Querydsl and QBE DataFetcher
We now provide Builder customizers to customize DataFetchers
created out of Querydsl and Query by Example repositories
by letting repositories implement customizer interfaces.

See gh-559
2022-12-06 15:39:35 +00:00
Brian Clozel
573e89987f Adapt to GraphQL over HTTP spec changes
As of graphql/graphql-over-http#215, the official media type for GraphQL
HTTP responses is now `"application/graphql-response+json"` instead of
`"application/graphql+json"`. The latter is now deprecated and support
will be removed in the future.

This commit now favors the new media type.
HTTP Clients are still supposed to send requests with the
`"application/json"` content type.

Closes gh-563
2022-12-05 14:47:51 +01:00
Brian Clozel
eb9b1f308d Add reflection hint for GraphQlWebSocketMessage
Prior to this commit, GraphQL applications using the WebSocket transport
would fail with an `java.lang.IllegalArgumentException: No JSON Encoder`
as the JSON codec was reflecting on the `GraphQlWebSocketMessage` to
check that it can handle this type, during startup time.

`GraphQlWebSocketMessage` is the message type being used for sending and
receiving GraphQL requests. This commit registers binding reflection on
this type as soon as a `GraphQlWebSocketHandler` (mvc or webflux) is
registered as a bean in the application.

This type is also used on the client side in the client
`WebSocketGraphQlTransport`. Because clients cannot be reliably detected
here in the application context or via classpath checks, this commit
also adds a JSON metadata file that adds reflection on the type, if and
only if the `WebSocketGraphQlTransport` is reachable by the static
analysis performed by GraalVM.

Fixes gh-560
2022-12-02 15:32:21 +01:00
Brian Clozel
a43c92854f Fix NullPointerException in Tracing support
Prior to this commit, using the tracing support could result in an
NullPointerException since the instrumentation expected the tracing
propagation information to be always available from the request
extensions.

This commit improves the strategy for extracing the inbound propagation
information.

First, the instrumentation now looks up the propagation information in
the GraphQL context first, then in the request extensions as a fallback.
We ensure that no NPE can be raised if the information is missing.
Some clients might change the propagation information in the request
extensions, but in the HTTP world, most clients will send those as HTTP
headers. We are adding a new `PropagationWebGraphQlInterceptor` that can
be configured on the application to copy the relevant HTTP headers from
the HTTP request to the GraphQL context. For other transports, we
currently advise the request extensions - both WebSocket and RSocket
multiplex over the same transport message, making this approach
impossible.

Fixes gh-547
2022-12-02 09:05:23 +01:00
Brian Clozel
5b4eb8cb73 Align observation convention with Micrometer best practices
This commit ensures that the contextual names of the observations all
start with `"graphql"` (lowercase) and that all key values are prefixed
with `"graphql.*"` for a cleaner namespace.

Fixes gh-558
2022-12-02 09:04:10 +01:00
Brian Clozel
5fe8123126 Upgrade to Micrometer 1.10.2
Closes gh-556
2022-12-01 17:43:24 +01:00
Brian Clozel
9165c25c25 Start building against Spring Framework 6.0.3 SNAPSHOTs
See gh-555
2022-12-01 17:41:31 +01:00
rstoyanchev
6958e39f5c Fix isOmitted to return true for omitted arguments
Closes gh-553
2022-12-01 12:54:15 +00:00
rstoyanchev
6119be935a Improve optional argument support for ProjectedPayload
This commit adds support for the ArgumentValue wrapper for passing null
when the argument is not present.

Closes gh-550
2022-12-01 12:53:04 +00:00
rstoyanchev
d8b3dad505 Polishing ProjectedPayloadMethodArgumentResolver
See gh-550
2022-12-01 11:38:47 +00:00
rstoyanchev
0baceda48c Remove samples from main
We no longer build the samples in the main branch due to dependency
issues between Boot starter dependencies and the project sources.
The samples really need to move out to an independent repository.
For now, this commit removes them from the main branch.

See gh-208
2022-11-24 11:06:45 +00:00
Spring Builds
2f27cc7c8e Next development version (v1.1.1-SNAPSHOT) 2022-11-22 11:10:35 +00:00
Brian Clozel
2de2c9fcea Upgrade to Reactor 2022.0.0
Closes gh-538
2022-11-22 11:09:05 +01:00
Brian Clozel
0dfe9e5706 Upgrade to Micrometer 1.10.1
Closes gh-539
2022-11-22 11:08:27 +01:00
Brian Clozel
2c2307abba Upgrade to Spring Data 2022.0.0
Closes gh-540
2022-11-22 11:07:50 +01:00
Brian Clozel
b3b1bca7b4 Upgrade to Spring Security 6.0.0
Closes gh-541
2022-11-22 11:07:28 +01:00
Brian Clozel
edc10144c5 Upgrade to Context Propagation 1.0.0
Closes gh-542
2022-11-22 11:06:55 +01:00
Brian Clozel
7894dd5dbe Upgrade to Spring Framework 6.0.0
This change aligns with the Jakarta API requirements in Spring
Framework.
This commit also upgrades optional dependencies with the latest compatible
versions.

Closes gh-543
2022-11-22 11:04:57 +01:00
Brian Clozel
ab6dde278c Merge branch '1.0.x' 2022-11-22 10:51:20 +01:00
Brian Clozel
99e9e6af85 Upgrade dependencies 2022-11-22 10:50:49 +01:00
rstoyanchev
78bdf306f9 Support schema transforming GraphQLTypeVisitor
Closes gh-536
2022-11-17 17:05:55 +00:00
rstoyanchev
1a3f0983e6 Merge branch '1.0.x' 2022-11-17 12:43:19 +00:00
Eric Fry
1427c7412f Fix typo in reference docs
Closes gh-530
2022-11-17 12:43:06 +00:00
rstoyanchev
f4485de73f Merge branch '1.0.x' 2022-11-17 11:57:22 +00:00
rstoyanchev
89a7145c03 Polishing contribution
Closes gh-367
2022-11-17 11:56:15 +00:00
kuraun
a927159410 Add mutationUpdateSalaryTest
Fixed the attribute value salary of UpdateSalaryInput of schema.graphqls
to the name of SalaryInput object. Also enabled @Secured.

See gh-367
2022-11-17 11:53:50 +00:00
rstoyanchev
34843f7399 Update reference to link to wiki for requirements 2022-11-16 11:39:22 +00:00
Brian Clozel
757d48255a Add AOT support for annotated Controllers
Prior to this commit, Spring for GraphQL would not support AOT and
GraalVM Native. Applications can perform reflection, load resources or
require JDK proxies at runtime and we need to contribute `RuntimeHints`
during the AOT phase.

This commit adds a new `BeanFactoryInitializationAotProcessor` component
that introspects GraphQL controllers and registers the relevant
reflection hints for binding on argument types and schema types.
This also registers JDK proxies for `@ProjectedPayload` support if
Spring Data Commons is present in the classpath.

Closes gh-495
2022-11-15 21:24:17 +01:00
rstoyanchev
fb636ad554 Support maxBatchSize via BatchMapping annotation
Closes gh-520
2022-11-14 17:13:03 +00:00
rstoyanchev
1eca67700f Support for default DataLoaderOptions
Closes gh-522
2022-11-09 15:52:41 +00:00
Brian Clozel
074817904a Add missing registry mirror vars in concourse tasks 2022-11-08 10:33:52 +01:00
rstoyanchev
ca90cedf3b Refine null handling in ClientResponseField#toEntity
closes gh-525
2022-11-04 13:53:52 +00:00
rstoyanchev
05939d5e7e Merge branch '1.0.x' 2022-11-04 13:50:57 +00:00
rstoyanchev
5905f02bd6 Deprecate ResponseField getError and hasValue
See gh-499
2022-11-04 11:01:58 +00:00
rstoyanchev
2dafd5dfc7 Merge branch '1.0.x' 2022-11-04 08:40:30 +00:00
Johan Wigert
6004937ad2 Fix typo in Javadoc of GraphQlTester
Closes gh-523
2022-11-04 07:24:34 +00:00
rstoyanchev
02f96b6bf4 Raise exception for any field error in retrieve
This commit aligns the behavior of retrieve with its Javadoc such that
any field error, including errors on nested fields, raises a
FieldAccessException

Closes gh-499
2022-11-04 06:36:15 +00:00
rstoyanchev
be9a21562c Polishing GraphQlArgumentBinder
See gh-349
2022-10-24 18:15:17 +01:00
rstoyanchev
16b1f94e69 Support binding to class with enum generic type
Closes gh-349
2022-10-21 18:24:17 +01:00
rstoyanchev
36501c1c28 Polishing
See gh-394
2022-10-21 17:33:33 +01:00
rstoyanchev
7f89bb92f6 Support argument binding to java.util.Set property
Closes gh-394
2022-10-21 16:27:33 +01:00
rstoyanchev
d9f815ed70 Add support for checking if an argument was omitted
Closes gh-518
2022-10-21 14:33:12 +01:00
rstoyanchev
8d80e5f883 Remove DataBinder from GraphQlArgumentBinder
DataBinder is not a great fit to bind GraphQL arguments which
are essentially a (structured) map of maps and collections, rather
than a (flat) map of property values with JavaBean paths.

We already navigate recursively the GraphQL arguments map, which
corresponds to the target Object structure, creating values, so all
we have to do is check for matching bean properties at each level
and set them.

See gh-516
2022-10-20 15:31:07 +01:00
rstoyanchev
5c75f7cf10 Merge branch '1.0.x' 2022-10-19 10:19:19 +01:00
rstoyanchev
11fab7dafd Polishing
See gh-449
2022-10-19 09:07:53 +01:00
rstoyanchev
d38ffeae6b Consistent raw value handling in GraphQlArgumentBinder
This commit ensures a single method is used to bind raw values,
whether those a top level argument value, or a value nested within a
collection or map.

See gh-449
2022-10-19 06:06:57 +01:00
rstoyanchev
bc8ee162f9 Minor refactoring in GraphQlArgumentBinder
See gh-449
2022-10-19 06:06:57 +01:00
rstoyanchev
9be5a95948 Support binding to Map as target value
Before this commit, we supported binding to a higher level object,
or a scalar, or a List of either, but not to a Map of either, which
requires similar support as what we have for a List, i.e. creating
the target Map and populating it in a recursive manner.

This commit adds that support.

Closes gh-449
2022-10-19 06:06:57 +01:00
Brian Clozel
e10674c7ad Upgrade to Spring Security 6.0.0-RC1
Closes gh-515
2022-10-18 16:46:50 +02:00