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
ab99dc2892
Improve ThreadLocal value handling
...
ThreadLocal values from a Servlet container thread maybe end up being
unnecessarily restored, e.g. if DataFetcher is invoked on the same
thread and then also removed, which then impacts the filter chain.
The ContextManager now saves the thread id when values are extracted
and ignores restore or remove calls if still on the same thread. This
should also be more optimal, avoiding ThreadLocal access if threads
aren't switched.
See gh-58
2021-06-24 17:15:19 +01:00
Rob Winch
52572c91b0
SecurityDataFetcherExceptionResolver.setAuthenticationTrustResolver
2021-06-22 15:33:04 -05:00
Rob Winch
4aed51438a
SecurityDataFetcherExceptionResolver handles AuthenticationException
...
This is unlikely to happen as authentication happens prior to reaching
the GraphQL APIs. However, a user may decide to implement security within
GraphQL as it is possible to do through a Spring Controller.
2021-06-22 15:32:38 -05:00
Rossen Stoyanchev
cedb5fb40d
Apply context to all exception resolvers
...
This is more consistent with DataFetcher's, it less brittle, and a
no-op where there is no ThreadLocal context.
2021-06-18 18:34:03 +01:00
Rossen Stoyanchev
efa585b887
Refine and clarify contracts for context management
...
Use ThreadLocalAccessor, the main API for ThreadLocal value management,
to state where this is supported, which is in Spring MVC, GraphQL
applications.
Improve Javadoc in related contracts as well including a minor
refactoring in ContextManager.
2021-06-18 18:07:05 +01:00
Brian Clozel
57fb7c59f5
Fix build and disable jjavaformat + checkstyle
...
Right now the Spring JavaFormat and Checkstyle arrangement doesn't work
for the Spring GraphQL source code.
This commit disables the dedicated Gradle conventions until we find a
better solution.
2021-06-16 12:13:35 +02:00
Rossen Stoyanchev
0ce48dc978
Turn off auto-formatting in Boot starter tests
2021-06-16 10:59:28 +01:00
Brian Clozel
16209d8d56
Merge pull request #57 from schauder/fix-schema-location
...
Correct location of schema in README.
2021-06-16 11:58:58 +02:00
Jens Schauder
ec9f3dd310
Correct location of schema in README.
2021-06-16 11:22:19 +02:00
Rossen Stoyanchev
43f9e34c81
Turn off auto-formatting where it reduces readability
2021-06-15 14:01:52 +01:00
Rossen Stoyanchev
a5f56ca3cb
Update README.md
2021-06-09 19:33:11 +01:00
Rob Winch
b276a39902
Add SecurityDataFetcherExceptionResolver
2021-06-09 08:54:52 -05:00
Rob Winch
0db7ee2be3
Merge pull request #55 from rwinch/webflux-security
...
Add WebFlux Security Sample
2021-06-08 14:31:34 -05:00
Rob Winch
17a56a1000
Use New Lamda Security Syntax
2021-06-02 17:05:52 -05:00
Rob Winch
d139e97cdb
Rename to SampleApplication
...
Follow convention of other sample applications.
2021-06-02 16:41:35 -05:00
Rob Winch
9a61207f2d
Remove DataFetchers
...
Follow the conventions of the other sample projects.
2021-06-02 16:40:55 -05:00
Rob Winch
16f2baa263
Format webflux-security
2021-06-02 16:36:10 -05:00
Rob Winch
96d25b2a91
employee-service -> webflux-security
2021-06-02 13:36:40 -05:00
Rob Winch
05098fd5d1
Update to Spring Boot 2.5.0
2021-06-02 13:29:22 -05:00
Rob Winch
d3a0fa1c4f
schema.graphqls->/graphql/schema.graphqls
2021-06-02 11:31:44 -05:00
Rob Winch
9b4c053a30
invalidCredentials
2021-06-02 11:31:44 -05:00
Rob Winch
ca369ecc7c
salaryDataFetcher returns Mono
...
We need the return type to be a Reactor type for the context to be
propagated.
2021-06-02 11:31:44 -05:00
Rob Winch
84b9b65777
Use headers instead of WithMockUser
...
This ensures that we don't get false positives when the Reactor return
types are not continuous.
2021-06-02 11:31:44 -05:00
Rob Winch
4b44f7a987
Use ADMIN role
2021-06-02 11:31:44 -05:00
Andreas Marek
2edc4c585a
add employee service example
2021-06-02 11:31:44 -05: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
39937679e3
Apply Spring JavaFormat to Spring GraphQL Test
...
See gh-54
2021-06-02 14:30:00 +02:00
Brian Clozel
d048c2e4fe
Apply Spring JavaFormat to Spring GraphQL
...
See gh-54
2021-06-02 14:30:00 +02:00
Brian Clozel
f8b90b592d
Apply Spring JavaFormat to Spring GraphQL Boot starter
...
This commit applies the build conventions to the Spring Boot GraphQL
starter module and fixes all formatting issues.
See gh-54
2021-06-02 14:30:00 +02:00
Brian Clozel
fc3a6403cb
Configure Spring JavaFormat in Gradle build
...
This commit creates a new build convention that applies the Spring
JavaFormat Gradle plugin.
This is also adding a default checkstyle configuration for this project.
See gh-54
2021-06-02 14:29:59 +02:00
Rossen Stoyanchev
266a2ddcda
Refactor GraphQlWebSocketHandler tests
2021-06-01 10:37:48 +01:00
Rossen Stoyanchev
ad8242e5e1
Add WebGraphQlHandler tests
...
See gh-53
2021-06-01 10:37:17 +01:00
Rossen Stoyanchev
1a1007ba59
Refactor WebInterceptor tests
2021-05-31 21:50:44 +01:00
Brian Clozel
de369ceeb3
Switch to 1.0.0-SNAPSHOT version
...
This commit changes the current version from 0.1.0 to 1.0.0 SNAPSHOT in
order to reflect the milestone changes that were done on the project.
2021-05-31 21:42:50 +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
ca18d03244
Add builder for WebGraphQlHandler
...
To allow adding more options when creating a WebGraphQlHandler.
See gh-53
2021-05-28 19:32:28 +01:00
Rossen Stoyanchev
eb88697b83
Polishing
2021-05-21 15:34:58 +01:00
Rossen Stoyanchev
cd8f4b672f
Fix NPE on errors without a path
...
Errors that originate from GraphQL itself don't seem to have a path.
2021-05-21 15:34:58 +01:00
Rossen Stoyanchev
24bf029b02
Replace custom WebSocket handler mapping logic
...
Closes gh-35
2021-05-21 15:03:37 +01:00
Rossen Stoyanchev
a438d81404
Reactive return type for DataFetcherExceptionResolver
...
Closes gh-52
2021-05-19 15:35:30 +01:00
Rossen Stoyanchev
827c188f63
Extract ContextManager from ReactorDataFetcherAdapter
...
This change separates the Reactor ContextView propagation into an
independent utility class to enable internal re-use.
See gh-52
2021-05-19 15:35:30 +01:00
Brian Clozel
5d4c08a30b
Upgrade to Gradle 7.0.2
2021-05-18 17:53:08 +02:00
Rossen Stoyanchev
484fb932ef
Replace QL with Ql for consistency with Spring naming
2021-05-14 21:32:54 +01:00
Rossen Stoyanchev
731417eb3f
Unwrap CompletionException
...
See gh-51
2021-05-14 20:50:10 +01:00
Rossen Stoyanchev
20b8a664bd
Move DataFetcherExceptionResolver to execution
...
DataFetcherExceptionResolver and ErrorType are better in the
execution package next to where they're used.
2021-05-14 18:29:43 +01:00
Rossen Stoyanchev
1a4ef20f8a
Add actual Javadoc to package-info
2021-05-14 16:26:01 +01:00