Commit Graph

436 Commits

Author SHA1 Message Date
rstoyanchev
d8d8229a33 Polishing
Missed one deprecation and doc updates.

See gh-244
2022-01-17 21:09:00 +00:00
rstoyanchev
5ff3f8b18d Refactor auto-registration of Querydsl and QBE fetchers
Replace the TypeVisitor with a WiringFactory that checks for existing
registrations in RuntimeWiring.Builder.

Closes gh-244
2022-01-14 19:00:36 +00:00
rstoyanchev
2ecac0bd35 Multiple WiringFactory registrations
CombinedWiringFactory makes use of multiple WiringFactory instances
possible, but RuntimeWiring.Builder does not use it by default.

This change enables use of multiple WiringFactory instances through
an extra callback on RuntimeWiringConfigurer that allows multiple
parties to add their own WiringFactory.

See gh-244
2022-01-14 18:44:54 +00:00
Brian Clozel
be74ba2b59 Remove experimental Spring Boot Starter
This commit removes the leftover sources after the experimental Spring
Boot starter has been moved to Spring Boot.

See gh-207
2022-01-13 16:43:37 +01:00
Brian Clozel
5b0496cbce Allow setting custom ExecutionId on RequestInput
Prior to this commit, we would use the request id as an execution id,
regardless of the overall GraphQL configuration.

This commit:

* adds a new executionId field on `RequestInput` and uses it in the
  `ExecutionInput`, if provided
* only uses the request id as a fallback if it's been asked to
* auto-detect in the `GraphQlService` whether a custom
  `ExecutionIdProvider` implementation was configured on `GraphQL`.

Closes gh-243
2022-01-13 14:41:31 +01:00
Brian Clozel
c9f35ce916 Upgrade base for CI image 2022-01-13 14:41:31 +01:00
rstoyanchev
7a7e2e87dc Update project name to Spring for GraphQL
Closes gh-255
2022-01-13 12:16:02 +00:00
Brian Clozel
10abd919ec Configure WebSocket transport with GraphiQL
This commit enhances the GraphiQL `index.html` to rely in the
graphiql-tools fetcher function; this supports both HTTP and WebSocket
transports.

As a follow-up, this also updates the `GraphiQlHandler` implementations
to also send a `wsPath` query param if a specific path has been
configured for the WebSocket support.

As an additional change, this commit also improves the fix for gh-231 as
it was incomplete: the generated query params were not taking the
context path into account.

Closes gh-131
Closes gh-231
2022-01-10 17:05:23 +01:00
rstoyanchev
8c655cb25d Simplify access to response headers in WebOutput
The response headers can now be changed directly without the need to
go through the builder.

See gh-229
2022-01-10 10:10:49 +00:00
rstoyanchev
22985efe6a Expose ExecutionInput in WebOutput
WebOutput now exposes the ExecutionInput prepared for the request and
no longer provides access to the WebInput which is already available
to a WebInterceptor.

Closes gh-229
2022-01-10 10:10:49 +00:00
rstoyanchev
c84f342daf Extract RequestOutput base class
See gh-229
2022-01-10 10:10:49 +00:00
rstoyanchev
44efeb6473 Improve wording on use of RuntimeWiringConfigurer
Closes gh-249
2022-01-10 10:10:49 +00:00
rstoyanchev
6106ef630a Polishing
See gh-239
2022-01-10 10:10:49 +00:00
Koen Punt
3fc447e50d Allow null values to async handler methods
Previously when the argument contained a null value (for example for nullified
continuation when using a suspend fun), it would fail to convert the arguments,
because of a `NullPointerException`.

By allowing the mono value be nullable it converts the arguments successfully.

Closes gh-239
2022-01-10 10:10:49 +00:00
rstoyanchev
c9d41ce955 WebGraphQlTester allows charset in response MediaType
Closes gh-247
2022-01-10 10:10:49 +00:00
Brian Clozel
3df738e8a2 Add CI jobs for releasing RC versions
Closes gh-221
2022-01-07 20:57:03 +01:00
Brian Clozel
1dc328cf65 Handle context path in GraphiQlHandler
Prior to this commit, the MVC `GraphiQlHandler` variant would not
generate a redirect link with the context path prefix.

This commit takes the context path into account and adds test coverage
to both variants.

Fixes gh-231
2022-01-07 20:33:09 +01:00
Koen Punt
fcb86e00d3 Add missing quote in reference documentation
Closes gh-225
2022-01-07 14:45:37 +01:00
Koen Punt
ec7096495c Update testing reference documentation
This commit updates the testing documentation after changes done
with the 1.0.0-M4 release.

Closes gh-224
2022-01-07 14:45:32 +01:00
Brian Clozel
a15fd29fc0 Remove Spring Boot Experimental Starter
The Experimental Spring Boot Starter for Spring GraphQL has been moved
to Spring Boot and will be released with Spring Boot 2.7.0.

Closes gh-207
2021-12-21 14:09:17 +01:00
Brian Clozel
2ded7469f4 Upgrade to Log4J 2.16.0
Closes gh-222
2021-12-14 22:22:31 +01:00
Rossen Stoyanchev
a514704b3f Add missing autoconfig for Query By Example
See gh-191
2021-12-13 10:24:50 +00:00
Brian Clozel
dd81d72fcb Start moving testing infra as test fixtures
This commit applies the `java-test-fixtures` to the project modules and
starts moving common infrastructure to the testFixtures configuration.

See gh-217
2021-12-10 22:52:14 +01:00
Brian Clozel
fe76809f3c Document spring-graphql-test dependency
This commit documents the fact that the `spring-graphql-test` dependency
is required for the testing support.

Fixes gh-205
2021-12-10 22:28:36 +01:00
Brian Clozel
b0994a1409 Fix docker hub credentials configuration
Closes gh-198
2021-12-10 22:08:30 +01:00
Brian Clozel
31e6851f1e Setup Docker support in CI
See gh-198
2021-12-10 21:15:53 +01:00
Brian Clozel
3e29e71a6e Add support for Bean Validation
This commit adds support for validating handler method inputs after
binding from the data fetching environment and before invoking the
handler method.

This support is based on Bean Validation and is enabled only if the
application context contains a `Validator` bean.

Closes gh-110
2021-12-10 15:50:16 +01:00
Rossen Stoyanchev
58f2afebb5 Polishing contribution
Closes gh-215
2021-12-09 21:23:59 +00:00
Greg L. Turnquist
ddec60a68e Add documentation for query by example.
See gh-215
2021-12-09 21:23:59 +00:00
Rossen Stoyanchev
5919178d91 Refactoring in GraphQL argument initialization
Consolidate GraphQL argument initialization by pushing logic from
ArgumentMethodArgumentResolver down into GraphQlArgumentInitializer,
which now takes the DataFetchingEnvironment, an optional argument name,
and a target type, and does the rest of the work.
2021-12-09 10:26:37 +00:00
Rossen Stoyanchev
b22cef00ab Support context parameters in @BatchMapping methods
Closes gh-172
2021-12-08 13:44:19 +00:00
Rossen Stoyanchev
50aeaba63e Add support for @ContextValue method parameters
See gh-172
2021-12-08 09:47:49 +00:00
Rossen Stoyanchev
e6453ef9b0 Ensure DataLoaderOptions are per request
See gh-212
2021-12-07 20:56:56 +00:00
Brian Clozel
b78808d54d Scan nested locations for GraphQL schema files
This commit changes the default value for the `spring.graphql.locations`
configuration property to `classpath:/graphql/**/`. By default, this
will scan nested locations for GraphQL schema files.

Fixes gh-210
2021-12-06 10:47:22 +01:00
Rossen Stoyanchev
6b1d5ebf64 Move graphiql index.html to spring-graphql
Closes gh-209
2021-12-02 15:53:36 +00:00
Rossen Stoyanchev
5597f543bd Polishing contribution
Closes gh-202
2021-12-01 18:39:17 +00:00
Rossen Stoyanchev
85cdadc2c8 Resolve merge conflict
The convert method in ArgumentMethodArgumentResolver is gone and in any
case ProjectedPayloadMethodArgumentResolver mainly needs to know the
name of the argument if an Argument annotation is present.

See gh-202
2021-12-01 17:28:23 +00:00
Mark Paluch
5aa72f216f Support for projected payloads
Controller methods now accept interface projections for individual or all
request arguments when Spring Data is on the class path.

See gh-202
2021-12-01 11:59:58 +00:00
Rossen Stoyanchev
4d99d2ab31 Refactoring in query package
Increase sharing between QBE and Querydsl:
- shared GraphQLTypeVisitor for auto-registration
- utility methods for repository info
2021-11-26 19:19:08 +00:00
Rossen Stoyanchev
38f9f987e4 Combine querydsl and querybyexample into one package
Following the addition of Query By Example, it makes sense to
consolidate the two that mirror each other, are closely related, and
can share package private support.

See gh-191
2021-11-26 19:19:08 +00:00
Rossen Stoyanchev
0f1073b7b5 Remove deprecated annotation 2021-11-26 19:19:08 +00:00
Rossen Stoyanchev
f81334f985 Move GraphQlArgumentInitializer to data package
Following the changes in #191, GraphQlArgumentInitializer is no longer
package private and also needs to be used in the DataFetcher for
Query By Example. As a first step, this change moves the class to
the top-level data package that is a parent of both.

See gh-191
2021-11-26 16:13:15 +00:00
Rossen Stoyanchev
3321121c41 Polishing and minor refactoring in GraphQlArgumentInitializer 2021-11-26 15:56:40 +00:00
Rossen Stoyanchev
425dc9c461 Polishing
See gh-191
2021-11-26 14:42:10 +00:00
Rossen Stoyanchev
cc5a8427a8 Update documentation
See gh-201
2021-11-26 14:26:50 +00:00
Rossen Stoyanchev
46d4d3d648 Polishing contribution
Closes gh-201
2021-11-25 18:12:23 +00:00
Mark Paluch
8704177741 Detect if repository is a QuerydslBinderCustomizer
We now detect Querydsl customizers during auto-registration for
repositories that implement QuerydslBinderCustomizer as default
interface method.

See gh-201
2021-11-25 18:00:27 +00:00
Rossen Stoyanchev
5c5cfdd277 Polishing contribution
Closes gh-201
2021-11-25 17:55:34 +00:00
Greg L. Turnquist
c9b5652833 Support for Query By Example based DataFetcher
This adds support for Spring Data's recent fluent query API via
Query by Example. It tests against Spring Data JPA and Spring Data MongoDB
for imperative, and Spring Data MongoDB for reactive support. To support
MongoDB testing, it uses Testcontainers.

See gh-191
2021-11-25 17:55:34 +00:00
Brian Clozel
b6897168cf Polish
See gh-183
2021-11-25 16:43:11 +01:00