Commit Graph

269 Commits

Author SHA1 Message Date
Rossen Stoyanchev
cae12820e4 Replace @GraphQlController in documentation snippets 2021-08-30 16:44:56 +01:00
Rossen Stoyanchev
4bd229d4b9 Deprecate @GraphQlController in favor of @Controller 2021-08-30 14:56:01 +01:00
Brian Clozel
7c58fb90af Fix configuration metadata for schema location property
Fixes gh-118
2021-08-27 20:39:46 +02:00
Brian Clozel
625f0b685b Add FailureAnalyzer for schema location issues
Prior to this commit, the schema locations configured with
`spring.graphql.schema.locations` could fail in several cases:
* one of the provided locations cannot be resolved as a Resource
* none of the provided locations holds an actual schema file

The latter can happen if several classpath locations match a given
location and the wrong one is considered first.

This commit introduces a new `MissingSchemaException` that holds the
locations information. We're adding the relevant FailureAnalyzer to help
developers troubleshoot such configurations issues.

Fixes gh-117
2021-08-27 20:36:05 +02:00
Brian Clozel
73aec66200 Dependency upgrades
GraphQL Java 17.1 -> 17.2
Reactor -> 2020.0.9 -> 2020.0.10
Spring Data 2021.0.3 -> 2021.0.4
Spring Security 5.5.1 -> 5.5.2
Jackson 2.12.4 -> 2.12.5
AssertJ 3.19.0 -> 3.20.2
2021-08-27 11:01:55 +02:00
Brian Clozel
c6430869a0 Upgrade to Gradle 7.2 2021-08-27 11:01:25 +02:00
Rossen Stoyanchev
7495f43670 Support GraphQLContext as a method argument 2021-08-26 19:50:01 +01:00
Rossen Stoyanchev
60b0684d80 Minor refactoring and polishing 2021-08-13 04:48:49 +01:00
Rossen Stoyanchev
6a71dc958d Fix link in README
Closes gh-109
2021-08-11 05:31:10 +01:00
Rossen Stoyanchev
50eef472c5 Add reference docs for annotated DataFetcher's
Closes gh-90
2021-08-11 05:23:27 +01:00
Rossen Stoyanchev
020303d0fd Dependency upgrades
GraphQL Java 17.0 -> 17.1
Reactor -> 2020.0.7 -> 2020.0.9
Spring Framework 5.3.7 -> 5.3.9
Spring Data 2021.0.1 -> 2021.0.3
Jackson 2.12.3 -> 2.12.4
2021-08-10 08:15:30 +01:00
Rossen Stoyanchev
a78abb7dc8 Polishing and minor refactoring in reference docs 2021-08-10 08:08:04 +01:00
Rossen Stoyanchev
3567a062ab Add RuntimeWiringConfigurer
Closes gh-107
2021-08-09 16:36:18 +01:00
Rossen Stoyanchev
8db2bf9680 Move querydsl support into sub-package
Following the addition of annotated DataFetcher's the `~.data.method`
with #90, it makes sense to have querydsl support at the same level
in a sibling package.
2021-08-09 12:49:36 +01:00
Rossen Stoyanchev
0d0b84dc8a Support for annotated DataFetcher's
Closes gh-61, gh-90
2021-08-09 12:37:47 +01:00
Rossen Stoyanchev
c2a996e564 Refactoring in spring-graphql tests 2021-08-04 13:20:22 +01:00
Rossen Stoyanchev
317d75cc8a Upgrade to GraphQL Java 17.0
Closes gh-84
2021-08-03 10:25:57 +01:00
Rossen Stoyanchev
15e2e6c271 Minor refactoring in GraphQlSource.Builder
Rename runtimeWiring to configureRuntimeWiring for consistency with
the configureGraphQl methods that's also Consumer based.
2021-07-26 16:50:12 +01:00
Brian Clozel
6cd0491077 Rename oci-build-task concourse resource 2021-07-26 15:42:23 +02:00
Brian Clozel
5c7b809aa3 Simplify GraphQlSource auto-configuration
This commit simplifies the `GraphQL` configuration by focusing the
infrastructure around the `GraphQlSource` auto-configuration.

With this commit, the auto-configuration contributes a single
`GraphQlSource` bean and removes the previoulsy contributed beans:
`GraphQlSource.Builder` and `RuntimeWiring`.

If a developer wants to take full control over the GraphQL setup, then
contributing a `GraphQlSource` bean is the easiest solution.

This commit also improves the `GraphQlSource.Builder` and allows for
customizing the `RuntimeWiring.Builder` instead of providing a direct
instance. This aligns well with the `RuntimeWiringBuilderCustomizer`
interface provided by the starter.

Closes gh-101
2021-07-23 10:00:29 +02:00
Brian Clozel
11fdb43238 Upgrade CI image 2021-07-23 10:00:29 +02:00
Brian Clozel
ed48f8f06e Upgrade to Artifactory Resource 0.0.17 2021-07-23 10:00:29 +02:00
em
a17a2c0af6 Rename RuntimeWiringCustomizer in reference docs
See 9d4ebfe743
Closes gh-102
2021-07-23 09:58:36 +02:00
Rossen Stoyanchev
0dbc3f12cd Minor sample refactoring 2021-07-21 16:06:12 +01:00
Rossen Stoyanchev
39702b9745 Extract boot starter docs into a dedicated asciidoc file 2021-07-21 14:30:58 +01:00
Rossen Stoyanchev
69b2476231 Show config for test support in reference docs
Closes gh-96
2021-07-21 14:18:10 +01:00
Rossen Stoyanchev
759b83ffa8 Upgrade to GraphQL Java 0.0.0-2021-07-21T06-48-56-713bb637
Use more efficient way to update the code registry in GraphQLSchema.

See gh-84
2021-07-21 13:52:49 +01:00
Rossen Stoyanchev
b22ac9bc1e Upgrade to GraphQL Java 17.0-beta1
See gh-84
2021-07-21 13:39:43 +01:00
Rossen Stoyanchev
f0ce9424bd Apply type visitors via SchemaTraverser
Transforming the schema can be expensive and should be separated from
use cases where type visitors don't need to change the schema.

For now we'll provide read-only traversal only. Separately we can
provide an option for schema transformation when it becomes necessary.
2021-07-20 16:49:32 +01:00
Rossen Stoyanchev
a316c0411a Add GraphQlRepository annotation and update documentation
See gh-93
2021-07-20 15:59:34 +01:00
Rossen Stoyanchev
4078799e34 Auto-register Querydsl DataFetcher's only for top-level queries
Closes gh-93
2021-07-20 13:42:26 +01:00
Rossen Stoyanchev
c148eb40b4 Auto registration of Querydsl DataFetcher's
See gh-93
2021-07-19 16:26:44 +01:00
Rossen Stoyanchev
873ecd6b29 Add GraphQlSourceBuilderCustomizer
See gh-93, gh-85
2021-07-19 16:26:44 +01:00
Koen Punt
701bfceb41 fix link and typo 2021-07-19 09:51:24 +01:00
Rossen Stoyanchev
89d89e38ff Use WebInput#toMap in DefaultWebGraphQlTester
It doesn't cause any issues but noticed from logging output that when
WebTestClient is used, we are serializing all of it, rather than just
the RequestInput properties.
2021-07-15 20:21:24 +01:00
Rossen Stoyanchev
706766536d Upgrade to GraphQL Java pre-17 version
See gh-84
2021-07-08 21:24:18 +01:00
Phillip Webb
9073d0d7ce Migrate to spring-asciidoctor-backends
Migrate documentation to use spring-asciidoctor-backends.
2021-07-07 20:30:10 +01:00
Rossen Stoyanchev
1ea5e346b9 Fix links in sample README's 2021-07-07 09:02:51 +01:00
Rossen Stoyanchev
27e883164f Polishing websocket sample 2021-07-06 16:34:21 +01:00
Rossen Stoyanchev
16ee8ecde0 Add link to samples from top-level README 2021-07-06 16:23:28 +01:00
Rossen Stoyanchev
72ee49269f Polishing 2021-07-06 16:18:09 +01:00
Brian Clozel
289f4d0bac Simplify security samples
As of gh-81, specific security components are contributed by the
GraphQL Security auto-configuration.

This commit removes those from the custom SecurityConfig classes.
2021-07-06 17:02:38 +02:00
Brian Clozel
f1bc239b57 Add Spring Security auto-configuration
This commit adds two new auto-configuration classes that provide the
relevant Spring Security infrastructure for GraphQL applications:

* a `ThreadLocalAccessor` that propagates the security context in
Spring MVC applications
* `DataFetcherExceptionResolver` implementations that resolve security
  exception from data fetchers, for both MVC and WebFlux

Closes gh-81
2021-07-06 16:58:34 +02:00
Brian Clozel
58d65d7a4c Refine auto-configurations conditions
Prior to this commit, auto-configurations were only checking for the
presence of GraphQL Java classes as guards, assuming that Spring
GraphQL classes were always on the classpath.

Auto-configurations are meant to be moved to the Spring Boot project in
the future, so this commit adds the relevant condition class checks to
reflect that spring-graphql might not be on the classpath.
2021-07-06 16:57:05 +02:00
Rossen Stoyanchev
69c2d08c71 Remove formatter-on/off comments 2021-07-06 15:51:50 +01:00
Rossen Stoyanchev
b594c19526 Add security package with basic infrastructure
Closes gh-80, gh-82
2021-07-06 15:38:16 +01:00
Rossen Stoyanchev
aea229778c Add README files to samples 2021-07-06 15:35:23 +01:00
Mark Paluch
08d49a848e Refine Querydsl integration documentation
Update repository example to implement Repository. Mention customizing and projection capabilities.

See gh-78
2021-07-06 08:55:31 +01:00
Rossen Stoyanchev
bac7461678 Add DataFetcherExceptionResolverAdapter
The adapter aims to:
- simplify the common case of synchronous resolution to a single error
- support ThreadLocal context propagation on an opt-in basis

This replaces the SyncDataFetcherExceptionResolver and removes the need
to propagate ThreadLocal context to every resolver.
2021-07-05 19:35:04 +01:00
Rossen Stoyanchev
a6211bda93 Minor ref doc updates 2021-07-05 16:04:50 +01:00