Commit Graph

953 Commits

Author SHA1 Message Date
rstoyanchev
3df8fcbbcb Refactoring in SchemaMappingInspector
Break down inspectType into two methods, one to inspect fields in a
GraphQLFieldContainer, and another to inspect a field output type.
The former is more straight forward and applies to Query, Mutation,
and Subscription. The latter does type handling such as unwrapping,
and nesting, and also requires a non-null Java ResolvableType.
2023-04-26 13:49:12 +01:00
rstoyanchev
29c5361651 Polishing SchemaMappingInspector 2023-04-26 13:49:12 +01:00
rstoyanchev
d4b2266ff7 Schema inspection handles List from Subscription
Normally a multivalue Publisher is collected to a List, so we can treat
it as a match for a List field. For subscriptions, however, such a
Publisher is left as an infinite stream, and we should not treat as a
match for a List, but rather expect it to be a stream of List items.

Discovered while working on gh-674, which is closely related.
2023-04-26 13:49:12 +01:00
rstoyanchev
133b4063e4 Schema inspection handles List with async wrapper
Fixes gh-674
2023-04-26 13:49:12 +01:00
Brian Clozel
01bc66acb1 Add support for GraphQlExceptionHandler in AOT mode
This commit adds the relevant reflection metadata for supporting
`@GraphQlExceptionHandler` annotated methods in controllers and
`@ControllerAdvice` beans.

Closes gh-677
2023-04-25 17:00:13 +02:00
Brian Clozel
b21e91fe32 Upgrade CI infrastructure
This commit upgrades versions for our CI infrastructure:

* Ubuntu OS
* Docker
* JDK 17
2023-04-24 23:23:19 +02:00
Brian Clozel
45b0a2a10e Upgrade to Gradle 8.1.1 2023-04-24 23:18:56 +02:00
Brian Clozel
9e4766a723 Remove deprecated PropagationWebGraphQlInterceptor
See gh-675
2023-04-24 23:02:32 +02:00
Brian Clozel
75fefe6a58 Merge branch '1.1.x' 2023-04-24 22:57:04 +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
6d8f789d38 SchemaMappingInspector detects unmapped DataFetcher's
Closes gh-671
2023-04-21 09:46:01 +01:00
rstoyanchev
a868331c4f Polishing 2023-04-21 08:55:00 +01:00
rstoyanchev
fb6a225193 Polishing in SchemaMappingInspector 2023-04-20 15:46:05 +01:00
rstoyanchev
d933828a23 Polishing
See gh-662
2023-04-19 16:23:39 +01:00
rstoyanchev
63fca20b5b Further update docs for schema mapping inspection
See gh-662
2023-04-19 16:06:03 +01:00
rstoyanchev
d4fa7cbe71 Add DEBUG logging for skipped types
See gh-662
2023-04-19 14:35:27 +01:00
rstoyanchev
ca526f5769 Document schema mapping inspection
Closes gh-662
2023-04-19 14:19:33 +01:00
rstoyanchev
5eb4e1a176 Polishing in GraphQlSource.Builder implementations 2023-04-19 14:19:33 +01:00
rstoyanchev
8ec513b799 Minor refactoring in reference docs
Update order of sections under GraphQlSource to reflect actual order of
initialization in addition to minor polishing.
2023-04-19 14:19:33 +01:00
rstoyanchev
8ab3d04224 Polishing for Java 17 baseline 2023-04-19 14:19:33 +01:00
rstoyanchev
3b1d1abfb9 Polishing in WebSocket support 2023-04-19 14:19:33 +01:00
Brian Clozel
84f8cfe446 Upgrade dependencies
* Spring Data 2023.0.0-RC1
* Spring Security 6.1.0-RC1
* Micrometer 1.11.0-RC1
* Micrometer Tracing 1.1.0-RC1
* Context Propagation 1.1.0-M2
* Jackson 2.15.0-rc3
* GraphQL Java 20.2
* Spring Framework 6.0.8

Closes gh-663
Closes gh-664
Closes gh-665
Closes gh-666
Closes gh-667
Closes gh-668
Closes gh-669
Closes gh-670
2023-04-19 11:37:55 +02:00
rstoyanchev
469d64bd93 SchemaMappingInspector enhancements
Support not only GraphQLObjectType, but any GraphQLFieldsContainer,
effectively also inspecting fields declared on an interface.

Add skipped types to report that includes any non-simple types that
have been skipped. Any type that is not a GraphQLFieldsContainer is
skipped, including unions. Types may also be skipped because of
insufficient Java object type information, e.g. controller method
declared to return Object or Mono<?>.

Do not report issues related to scalar and enum type fields, which
don't have any structure and don't need further checks.

See gh-662
2023-04-17 12:28:40 +01:00
rstoyanchev
ed94ef0bce Inline nested SchemaMappingInspection class 2023-04-14 12:13:32 +01:00
rstoyanchev
145ab22bf3 Merge branch '1.1.x' 2023-04-14 08:29:53 +01:00
rstoyanchev
c650db895b Add link in documentation to Apollo federation sample
Closes gh-384
2023-04-14 08:27:17 +01:00
rstoyanchev
b7d1e6e9d2 Pass attributes in HttpGraphQlTransport
Closes gh-659
2023-04-14 06:59:34 +01:00
rstoyanchev
4a0d01a33b Fix auto-registration issue with non-null List
Closes gh-661
2023-04-14 06:55:36 +01:00
rstoyanchev
1e74820077 Consistent since tag format 2023-04-14 06:43:08 +01:00
rstoyanchev
882ad0eb26 Allow fallback on field access for argument binding
Closes gh-599
2023-04-13 18:37:55 +01:00
rstoyanchev
bf1f4065b4 Pass attributes in HttpGraphQlTransport
Closes gh-659
2023-04-13 17:59:18 +01:00
rstoyanchev
56b0b168b9 Update SchemaMappingInspector to support Connection types
Closes gh-656
2023-04-13 16:56:26 +01:00
rstoyanchev
dedebf4bad Make CursorStrategy and default ScrollSubrange nullable
See gh-597
2023-04-13 12:54:51 +01:00
rstoyanchev
d485dcca2c Fix test failure in reactive QBE test
See gh-597
2023-04-13 12:36:27 +01:00
rstoyanchev
650137f6b3 Update Query By Example pagination tests
See gh-597
2023-04-13 12:25:51 +01:00
rstoyanchev
a0d7cc1c8c Expose CursorsStrategy and Subrange as builder options
This makes it possible to customize these settings individually,
optionally, and via QuerydslBuilderCustomizer.

See gh-597
2023-04-12 11:18:40 +01:00
rstoyanchev
1f0c5239c0 Reference docs for Querydsl and QBE pagination
Closes gh-597
2023-04-12 10:26:42 +01:00
rstoyanchev
d9d67c7f90 Pagination support for Querydsl and QBE
See gh-597
2023-04-08 16:34:19 +01:00
rstoyanchev
2d071a42ee AutoRegistrationRuntimeWiringConfigurer refactoring 2023-03-31 12:09:37 +01:00
rstoyanchev
3ebdce0f7a Pagination test refactoring 2023-03-30 19:17:35 +01:00
rstoyanchev
911b78237c Querydsl and QBE nest into single argument input type
Closes gh-216
2023-03-23 18:29:57 +00:00
Brian Clozel
4ae21a8b5a Upgrade build to Gradle 8.0.2 2023-03-21 17:47:04 +01:00
rstoyanchev
1a24e31f0f Polishing documentation
See gh-620
2023-03-21 16:09:42 +00:00
rstoyanchev
ee493ef911 Polishing documentation
See gh-620
2023-03-21 13:58:09 +00:00
rstoyanchev
4f873a31eb Add documentation for pagination
Closes gh-620
2023-03-21 12:13:49 +00:00
rstoyanchev
627d4f43fa CursorStrategy is now also detected as a bean
See gh-620
2023-03-21 12:13:49 +00:00
Spring Builds
db55ee2c2c Next development version (v1.1.4-SNAPSHOT) 2023-03-21 10:22:40 +00:00
Brian Clozel
fd46e0d75a Upgrade to Spring Security 6.1.0-M2
Closes gh-651
2023-03-20 20:03:07 +01:00
Brian Clozel
f012a460ae Upgrade dependencies
This commit upgrades mandatory and optional dependencies:

* Spring Data 2023.0.0-M3
* Micrometer 1.11.0-M2
* Micrometer Tracing 1.11.0-M2
* Kotlin 1.8.10

Closes gh-648
Closes gh-649
Closes gh-650
Closes gh-652
2023-03-20 18:40:54 +01:00