Commit Graph

45 Commits

Author SHA1 Message Date
rstoyanchev
4818ee6c81 Upgrade samples to match the GraphQlTest updates
See gh-310
2022-03-09 12:47:26 +00:00
rstoyanchev
19793a6e74 Revert "Pin version to 1.0.0-M5 in samples"
This reverts commit b40375f1f2.
2022-03-09 08:57:10 +00:00
rstoyanchev
b40375f1f2 Pin version to 1.0.0-M5 in samples
This is necessary until Boot catches up with spring-graphql snapshots.
2022-03-07 10:39:59 +00:00
Brian Clozel
410e7e60ae Revisit Gradle repositories configuration 2022-01-19 14:22:04 +01:00
rstoyanchev
7a7e2e87dc Update project name to Spring for GraphQL
Closes gh-255
2022-01-13 12:16:02 +00: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
02089a8542 Upgrade to Spring Boot 2.6.0-RC1
This commit upgrades the experimental starter to Spring Boot 2.6.0-RC1
and aligns all dependency versions to the Spring Boot dependency
management in 2.6.

This commit also removes temporary workarounds in the testing support or
in declared dependencies now that we've moved to 2.6.

While we're now using Spring Boot 2.6 as a reference version for this
project, the baseline didn't change and this commit documents the
requirements for this project; the Spring Data version, for our QueryDSL
support, is a specific example of that.

Fixes gh-181
2021-11-09 09:39:14 +01:00
Brian Clozel
02d6cb1c59 Refine GraphQL testing infrastructure
After the introduction of the `@GraphQlTest` annotation, this commit
adds further refinements to the testing infrastructure.

Now, `@GraphQlTest` is completely independent of any web framework and
contributes a `GraphQlTester` component.

`@SpringBootTest` integration tests with mock servers only require an
`@AutoConfigureWebGraphQlTest` to get a `WebGraphQlTester` component.

Closes gh-75
2021-10-27 21:16:03 +02:00
Mark Paluch
7fea8730db Migrate QuerydslDataFetcher to use fluent Querydsl API
Remove supporting classes for external projection as projections are
handled by Spring Data directly.

See gh-168
2021-10-27 16:51:21 +01:00
Brian Clozel
e053e14158 Add GraphQlTest annotation
Prior to this commit, we could only test Spring GraphQL applications
with a complete application - all application and infrastructure
components were involved. While using `@SpringBootTest` is often useful
for complete integration tests (with or without a live running server),
we often want to write lean integration tests and test slices of our
application.

Just like `@WebMvcTest` or `@WebFluxTest`, this commit introduces the
support for `@GraphQlTest`. This annotation helps us to test a
particular slice of our application: a hand-picked selection of
`@Controller`, plus `RuntimeWiringConfigurer` and `WebInterceptor`
beans.

Other `@Component` must be imported or mocked for those tests.

This commit also refactors the existing auto-configuration to enable
this use case. The `WebGraphQlHandlerAutoConfiguration` now holds the
required components for `@GraphQlTest`, while other web-related
auto-configurations bring the web framework and transport
infrastructures.

Closes gh-75
2021-10-22 22:00:02 +02:00
Rossen Stoyanchev
762b9f06c2 Support query files for input in GraphQlTester
Closes gh-67
2021-10-01 17:36:49 +01:00
Brian Clozel
b03097ad47 Remove attributes from Argument annotation
Prior to this commit, the `@Argument` annotation would support two
attributes: `required` and `defaultValue`, specifying whether arguments
should be considered as required and default values to use if they're
not present.

This can be problematic as this can already be specified at the schema
level.

To avoid duplication and invalid setups betweens schema and Controllers,
this commit removes those attributes in favor of the schema definition.

Closes gh-150
2021-09-24 13:47:56 +02:00
Brian Clozel
f69aa39211 Only scan for *.graphqls and *.gqls schema files
Prior to this commit, the auto-configuration was scanning for
`"*.graphql,*.gql,*.graphqls,*.gqls"` files in the configured locations.
This was not flexible enough, as developers could not customize the
considered file extensions when scanning for files.

This commit provides a new `spring.graphql.schema.file-extensions`
configuration property that enables such customizations.

Because `"*.graphql,*.gql"` extensions seem to be tied to queries
(and not schemas), this commit also changes the default value to only
consider the `"*.graphqls,*.gqls"` file extensions by default.

Closes gh-134
Closes gh-135
2021-09-20 10:29:41 +02:00
Brian Clozel
762f59b2f3 Configure compiler conventions in modules
This commit applies the Compiler Conventions Gradle plugin to the
project modules and fix the issues raised by the compiler linter.

This commit also moves version management to the main build file for a
few dependencies, aligning the versions in the process.
2021-09-16 19:54:25 +02:00
Rossen Stoyanchev
892d2bd344 Use properties for Boot and GraphQL Java versions 2021-09-16 11:15:47 +01:00
Rossen Stoyanchev
1b72e8107d Update Spring Boot version 2.5.0 -> 2.5.4 2021-09-16 10:21:45 +01:00
Rossen Stoyanchev
60e65078c2 Fix outdated links in README files 2021-08-31 07:44:10 +01:00
Rossen Stoyanchev
4bd229d4b9 Deprecate @GraphQlController in favor of @Controller 2021-08-30 14:56:01 +01:00
Rossen Stoyanchev
6a71dc958d Fix link in README
Closes gh-109
2021-08-11 05:31:10 +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
a316c0411a Add GraphQlRepository annotation and update documentation
See gh-93
2021-07-20 15:59:34 +01:00
Rossen Stoyanchev
c148eb40b4 Auto registration of Querydsl DataFetcher's
See gh-93
2021-07-19 16:26:44 +01:00
Rossen Stoyanchev
72ee49269f Polishing 2021-07-06 16:18:09 +01:00
Rossen Stoyanchev
69c2d08c71 Remove formatter-on/off comments 2021-07-06 15:51:50 +01:00
Rossen Stoyanchev
aea229778c Add README files to samples 2021-07-06 15:35:23 +01:00
Rossen Stoyanchev
16656d623f Polishing Javadoc and in security sample 2021-07-05 14:36:25 +01:00
Stephane Nicoll
9d4ebfe743 Polish 2021-06-30 15:44:24 +02:00
Rossen Stoyanchev
17bf9ee287 Polishing
Closes gh-59
2021-06-24 21:13:14 +01:00
Mark Paluch
2d53fdc73f Spring Data repositories that support Querydsl
Spring Data repositories that support Querydsl are now supported
as DataFetchers returning single objects and iterables including
projection support.

See gh-59
2021-06-24 21:13:14 +01:00
Rossen Stoyanchev
43f9e34c81 Turn off auto-formatting where it reduces readability 2021-06-15 14:01:52 +01:00
Brian Clozel
f8b2ad552f Refactor project build
This commit refactors the project build to better share dependency
management definitions between modules.

This also upgrades the project to Spring Boot 2.5.0.

Closes gh-45
2021-06-02 15:45:51 +02:00
Brian Clozel
53e2a379de Reformat sample applications
Fixes gh-54
2021-06-02 14:30:00 +02:00
Brian Clozel
847c10be27 Add GraphQlTester test auto-configuration
This commit introduces the auto-configuration infrastructure for testing
Spring GraphQL applications with mock/embedded servers.

The new `@AutoConfigureGraphQlTester` annotation can contribute a
`GraphQlTester` bean to the test context for testing the application.

Closes gh-46
2021-05-31 21:35:54 +02:00
Rossen Stoyanchev
56917d8d83 ThreadLocal context propagation for DataFetcher's
The WebMvc starter now supports propagation of ThreadLocal values
extracted at the level of the HTTP handler.

Closes gh-53
2021-05-28 19:32:48 +01:00
Rossen Stoyanchev
484fb932ef Replace QL with Ql for consistency with Spring naming 2021-05-14 21:32:54 +01:00
Brian Clozel
f70e552c6a Change default schema location to /graphql/schema.graphqls
This commit changes the default location for the GraphQL schema from
`classpath:schema.graphqls` to `classpath:/graphql/schema.graphqls`.

We're also adding `.graphqlconfig` files that are leveraged by a GraphQL
JS plugin in IntelliJ IDEA.

Closes gh-44
2021-05-11 15:52:58 +02:00
Brian Clozel
2d97e326e2 Add schema printer endpoint
This commit auto-configures a web endpoint that prints the GraphQL
schema of the application.

Closes gh-13
2021-05-11 11:54:17 +02:00
Rossen Stoyanchev
00b01ee524 Rename package for GraphQLTester 2021-04-26 21:59:52 +01:00
Rossen Stoyanchev
1e619263d2 Reactor DataFetcher support
Closes gh-47
2021-04-26 10:03:53 +01:00
Rossen Stoyanchev
0d52bfc207 Update samples to use GraphQLTester
See gh-43
2021-04-15 13:01:19 +01:00
Rossen Stoyanchev
645cf21f17 Update dependencies 2021-04-14 21:24:04 +01:00
Rossen Stoyanchev
3843e83d43 Add tests to webmvc-http sample 2021-03-11 17:13:25 +00:00
Andreas Marek
5ccacd1bb4 use the more idiomatic Query type instead QueryType 2021-01-18 21:35:36 +00:00
Brian Clozel
633ee1a1b5 Refactor project structure
This commit refactors the project structure to regroup GraphQL web
support under the spring-graphql-web module, and move all the Spring
Boot support classes under a single graphql-spring-boot-starter one.

Right now, the starter module contains everything: classes for MVC,
WebFlux and Actuator support as well as required dependencies. We will
change that in the future.
2021-01-05 16:35:34 +01:00
Rossen Stoyanchev
35c2068bdf Rename webmvc-http-endpoint to webmvc-http 2021-01-03 21:40:23 +00:00