Commit Graph

283 Commits

Author SHA1 Message Date
Rossen Stoyanchev
b021663f5b Update docs for batch loading
Closes gh-63
2021-09-15 15:54:00 +01:00
Koen Punt
e24943ac70 docblock update 2021-09-14 17:55:55 +01:00
Rossen Stoyanchev
1bdcb8afe8 Add DataLoaderMethodArgumentResolver
This commit adds support for DataLoader<K,V> arguments on annotated
handler methods, where the key for the lookup is the class name of the
value type or the parameter name.

See gh-63
2021-09-14 09:15:41 +01:00
Rossen Stoyanchev
ddafc93c6c Add BatchLoaderRegistry
The registry is an application API for registering batch loading
functions along with DataLoaderOption's.

See gh-63
2021-09-14 09:09:44 +01:00
Rossen Stoyanchev
9228872f44 Improve exception logging 2021-09-13 10:54:39 +01:00
Rossen Stoyanchev
a056d5ba06 Add Exceptions section to Boot starter ref docs
See gh-121
2021-09-03 14:01:10 +01:00
Brian Clozel
0587913ccb Allow configuring schema through GraphQlSource customizer
As of gh-117, the GraphQlAutoConfiguration throws an exception if no
schema file was found while scanning configured locations.
This prevents developers from manually configuring the schema using
`GraphQlSourceBuilderCustomizer` instances.

This commit ensures that a `MissingSchemaException` is only raised if no
schema was configured at the time we're building the actual
GraphQlSource.

This exception is later wrapped by the GraphQlAutoConfiguration to raise
an `InvalidSchemaLocationsException` with useful information about
configured schema locations.

Fixes gh-124
2021-09-02 11:36:49 +02:00
Brian Clozel
771c42bfbe Fix missing GitHub credentials in release pipeline 2021-08-31 18:06:37 +02:00
Brian Clozel
0c17ad59bf Upgrade JDK versions 2021-08-31 17:39:49 +02:00
Brian Clozel
d3316d7a72 Upgrade Ubuntu in CI image 2021-08-31 17:39:31 +02:00
Rossen Stoyanchev
4bfe85e6b3 Fix package cycle 2021-08-31 14:58:13 +01:00
Rossen Stoyanchev
a98ca42981 Add resolver for @Argument Map<String, Object>
Closes gh-113
2021-08-31 14:44:47 +01:00
Rossen Stoyanchev
60e65078c2 Fix outdated links in README files 2021-08-31 07:44:10 +01:00
Rossen Stoyanchev
8cebe20a56 Defensively build GraphQLError
GraphqlErrorBuilder expects a non-null error message so we need to
check if the exception has one, or otherwise the resulting assert
error masks the original one.
2021-08-30 16:49:28 +01:00
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