Commit Graph

421 Commits

Author SHA1 Message Date
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
Brian Clozel
cfd0403008 Make id mandatory for RequestInput
This commit is a follow up of 2e4158c and makes the following changes:

* the id is now a mandatory attribute for `WebInput` and `RequestInput`
* a consistent IdGenerator strategy is configured for all requests

Closes gh-183
2021-11-25 12:30:56 +01:00
Rossen Stoyanchev
9ce4b6801e Allow mapping annotations at the class level
Closes gh-195
2021-11-25 11:09:30 +00:00
Brian Clozel
7543120006 Document Querydsl build setup
Closes gh-193
2021-11-25 11:48:31 +01:00
Rossen Stoyanchev
5f260d12f6 Polishing 2021-11-25 10:44:33 +00:00
Rossen Stoyanchev
d9e988670e .gitignore generated sources such as Querydsl 2021-11-25 10:37:43 +00:00
Brian Clozel
201c828b38 Polish 2021-11-25 10:55:37 +01:00
Brian Clozel
b9932735db Revert "Auto-configure DataLoaderRegistrar components"
This reverts commit 36a84f58bd.
2021-11-25 10:55:20 +01:00
Janne Valkealahti
f498407087 Add gitignore for eclipse
- For eclipse and vscode language server
  ignore generic files/dirs created.

Closes: gh-194
2021-11-24 20:16:08 +01:00
Brian Clozel
36a84f58bd Auto-configure DataLoaderRegistrar components
This commit configures all `DataLoaderRegistrar` application components
with the `GraphQlService`. This allows applications to contribute
`DataLoader` instances without using the annotated-controller
programming model.

Closes gh-189
2021-11-24 16:18:40 +01:00
Brian Clozel
d0adceee4b Configure GraphQlProperties even if GraphQlSource is defined
Prior to this commit, the main GraphQL auto-configuration would be
guarded with a condition on a `GraphQlSource` bean being missing. While
we want to prevent the auto-configuration from registering such a bean
if the user configuration already did so, we should still contribute the
`GraphQlProperties` bean to the context, as it is required for other
purposes.

This commit moves the condition directly on the bean method to avoid
this.

Fixes gh-186
2021-11-24 10:16:38 +01:00
Brian Clozel
2e4158cae8 Set ExecutionId on web requests
Prior to this commit, the `WebInput` would hold an `id` attribute that
correlate the request and response messages on a multiplexed connection.

This commit moves this concept directly to the `RequestInput` so that it
can be used as an `ExecutionId` for all types of transports, if
availble.

This id was already set on the `WebInput` in the WebFlux case with the
id coming from the exchange, but it also creates an id and set it for
the MVC case. This id is then propagated to GraphQL's `ExecutionInput`.

See gh-183
2021-11-23 20:10:53 +01:00
Mingyuan Wu
d9404ea3d6 Upgrade to Spring Boot 2.6
Closes gh-187
2021-11-22 14:32:50 +01:00
Rossen Stoyanchev
b69b92d2c8 Update DataFetcherExceptionResolverAdapter
Make it protected since it needs to be extended and add factory method
with a BiFunction as an alternative.
2021-11-17 11:27:20 +00:00
Rossen Stoyanchev
e2a53759cb Switch DataFetcherExceptionHandler to async contract 2021-11-17 03:50:33 +00:00
Rossen Stoyanchev
0df1884500 Add option for expected errors to GraphQlTester
Closes: gh-175
2021-11-16 21:43:52 +00:00