Commit Graph

849 Commits

Author SHA1 Message Date
Brian Clozel
d261b292b5 Upgrade to GraphQL Java 20.0
See gh-596
2023-02-01 15:43:24 +01:00
Brian Clozel
009c5eb2d3 Merge branch '1.1.x' 2023-02-01 15:31:52 +01:00
Brian Clozel
52dce6bcf8 Configure Docker credentials when fetching Concourse resources 2023-02-01 15:31:23 +01:00
Brian Clozel
33e4908147 Merge branch '1.1.x' 2023-02-01 15:23:51 +01:00
Brian Clozel
9bd137ed52 Set current version to 1.2.0-SNAPSHOT 2023-02-01 15:17:14 +01:00
Brian Clozel
a4981e076b Create 1.2.x Concourse pipeline
This commit also upgrades Concourse resources to their latest versions.
2023-02-01 15:09:39 +01:00
Brian Clozel
a4f04293e0 Update CI to use the new 1.1.x branch
This commit updates the Concourse CI pipeline to use the new 1.1.x
branch for this generation, as the main branch is now dedicated to 1.2.x
features.
2023-02-01 14:45:51 +01:00
rstoyanchev
562d39a9a2 Revert "Remove ArgumentMapMethodArgumentResolver"
This reverts commit 7b30159109.
2023-02-01 09:46:14 +00:00
rstoyanchev
483ef31b5f Add link to Getting Started Guides
Closes gh-551
2023-02-01 09:44:29 +00:00
rstoyanchev
7b30159109 Remove ArgumentMapMethodArgumentResolver
Dropping this the dedicated resolver for @Argument Map<String, Object>
leaves it to ArgumentMethodArgumentResolver and
ArgumentsMethodArgumentResolver to handle the case of
Map<String, Object>, treating it either as a raw argument value for a
named argument, or as the full raw arguments map.

Closes gh-548
2023-01-27 19:38:55 +00:00
rstoyanchev
4c3e75a1e9 Add MethodParameter validation
Validate an individual method parameter when it's annotated with
Spring's @Validated rather than with @Valid, in which case method
validation does not validate the parameter.

Closes gh-571
2023-01-27 19:38:55 +00:00
rstoyanchev
f65b83f65e Optimize performance of method validation
Perform the check for whether validation for a HandlerMethod is needed
earlier and only once rather than in the constructor of
DataFetcherHandlerMethod.

Make the validation helper passed to DataFetcherHandlerMethod stateful,
so that validation groups are also determined once on startup.

See gh-571
2023-01-27 19:38:55 +00:00
Brian Clozel
4c1e7c56e5 Upgrade to spring-asciidoctor-backends 0.0.4
This release is available on Maven Central, whereas 0.0.3 is only
present on repo.spring.io/release.
2023-01-27 09:50:12 +01:00
Brian Clozel
e852fbd2c6 Upgrade Java 17 version in CI build 2023-01-19 09:55:00 +01:00
rstoyanchev
d9497ffd65 Add Boot Starter section to reference
Closes gh-598
2023-01-13 18:25:10 +00:00
rstoyanchev
e316cdf13b Switch order of sections in reference docs
Client and Testing after all others such as Security,
Observability, and GraalVM.
2023-01-13 16:05:36 +00:00
Brian Clozel
2c9a511aef Upgrade Gradle conventions & enterprise plugins 2023-01-13 14:32:35 +01:00
Brian Clozel
f8c3e496aa Upgrade to Kotlin 1.7.22 2023-01-13 14:30:22 +01:00
Brian Clozel
d64eb9b9cf Upgrade to Gradle 7.6 2023-01-13 14:24:30 +01:00
Brian Clozel
ef7784ee1c Refactor Kotlin configuration in build 2023-01-11 10:04:02 +01:00
Brian Clozel
222149c142 Document Micrometer Observability support
This commit adds a new Observability section in the reference
documentation, explaining the request and data fetcher observations
created by the new instrumentation.

Closes gh-595
2023-01-10 16:15:48 +01:00
Brian Clozel
4d192318b6 Configure Backport Bot for GitHub workflows
This commit configures the Backport Bot for the repository workflows.
See https://github.com/spring-io/backport-bot

This will create backport issues whenever issues created on the main
line are tagged with the relevant issue label.
2023-01-05 14:30:14 +01:00
rstoyanchev
2c77433ebd Support custom "subscription" type name
Closes gh-590
2023-01-04 16:21:32 +00:00
Spring Builds
496bc31151 Next development version (v1.1.2-SNAPSHOT) 2022-12-20 10:16:21 +00:00
rstoyanchev
eb25ea57ab Polishing
Closes gh-573
2022-12-19 20:22:46 +00:00
Tony Marjakangas
608e4dd7e4 Fixed client example with toEntity on field
ResponseField does not contain toEntity but ClientResponseField does
and is returned by response#field.

See gh-573
2022-12-19 20:22:46 +00:00
rstoyanchev
3bee3e81cc Use ParameterNameDiscoverer with BatchMapping
Closes gh-562
2022-12-19 20:22:46 +00:00
Brian Clozel
1e51daa225 Upgrade to Spring Security 6.0.1
Closes gh-587
2022-12-19 20:56:49 +01:00
Brian Clozel
fc81402659 Upgrade to Reactor 2022.0.1
Closes gh-586
2022-12-19 20:56:08 +01:00
Brian Clozel
e252724c8f Fix warnings in reference docs code snippets 2022-12-19 20:54:54 +01:00
Brian Clozel
acf1f30c40 Document GraalVM Native support
This commit documents the GraalVM Native image support in Spring for
GraphQL and lists relevant pointers to the Spring Framework and Spring
Boot documentations.

This also explains how developers are expected to provide reachability
hints for the cases where the AOT processing is not able to discover the
relevant types.

Closes gh-581
2022-12-16 10:31:11 +01:00
Brian Clozel
decbc40e48 Upgrade to Spring Framework 6.0.3
Closes gh-555
2022-12-15 16:38:17 +01:00
rstoyanchev
089c754c73 Improve explanation of custom scalars vs Jackson
See gh-569
2022-12-09 16:20:49 +00:00
Brian Clozel
d1300f56bf Add reachability metadata for GraphQL client resources
This commit adds reachability metadata for resources loaded by the
`GraphQlClient` and `GraphQlTester` when using the `document("name")`
API variant. This method loads the query file from the classpath at
particular locations, namely `"classpath:graphql-documents/"` and
`"classpath:graphql-test/"` with the `".graphql"` and `".gql"` file
extensions.

This commit adds the relevant resource metadata so that such resources
are loaded in the GraalVM native image at build time when the client or
the tester are reachable through the static analysis.

Fixes gh-575
2022-12-09 15:15:37 +01:00
Brian Clozel
5f1ca8cda3 Add reachability metadata for RSocket client
Prior to this commit, using the RSocket client in a native image would
fail when setting up the codecs, if the chosen transport was WebSocket.
This is due to the fact that the `GraphQlWebSocketMessage` type was not
registered for reflection and the proper codec could not be detected as
a result.

This commit adds reflection metadata for this type.

Fixes gh-574
2022-12-09 15:13:12 +01:00
Brian Clozel
0362bdf100 Log schema resources during application startup
This commit logs the number of schema resources that were loaded to
create the GraphQL schema, at the INFO level. If DEBUG is enabled for
this package, the description of all schema resources will be logged as
well.

Closes gh-566
2022-12-08 17:06:43 +01:00
rstoyanchev
0bd30582e5 Add factory method for DataFetcherExceptionHandler
Closes gh-552
2022-12-08 14:43:41 +00:00
rstoyanchev
75d5d4b33a Allow binding raw map to Map<String,?>
Closes gh-554
2022-12-08 14:43:41 +00:00
Brian Clozel
c16521c907 Move interception code snippets to Java classes
This commit starts movint code snippets from the reference documentation
to actual Java classes so that they're compiled and checked at build
time.
2022-12-06 17:07:43 +01:00
Brian Clozel
3d1f3b2fe9 Upgrade to Spring asciidoctor backends 0.0.3
This commit also applies dependency management and dependencies
to the spring-graphql-docs module for compiling code snippets.
2022-12-06 17:07:43 +01:00
Brian Clozel
6029e45825 Reflect media type changes in reference documentation
This commit mentions the `"application/graphql-response+json`" media
type in the reference documentation as the main media type used by the
server.

See gh-563
2022-12-06 17:07:43 +01:00
Brian Clozel
70afadc04a Rewrite anchors in reference documentation
This commit ensures that all anchors in the reference documentation
follow a `"section.sub.title"`-like pattern to better align with the
spring-asciidoctor-backends best practices. This will allow an easier
integration with code snippets.

All rewritten anchors are listed in the anchor-rewrite.properties file
for automatic redirection.
2022-12-06 17:07:40 +01:00
Brian Clozel
0458f15ddd Move deployment repository config to a Gradle convention
This commit moves the configuration of a local Maven deployment
repository in a dedicated Gradle convention and applies it to all
sub-projects. This separates the publishing configuration for actual
project modules (that are meant to be published on Maven Central) from
the infrastructure sub-projects such as the documentation one.
2022-12-06 17:05:50 +01:00
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