Commit Graph

114 Commits

Author SHA1 Message Date
Rossen Stoyanchev
e5a92a310d Introduce GraphQLSource
A pluggable abstraction to encapsulate the way GraphQL is initialized and
the way it is sourced at runtime.

Closes gh-48
2021-04-28 18:53:04 +01:00
Brian Clozel
f3d941c0f4 Do not ignore ci paths in main git repo
Looking at paths under ci/* is now required to build the main CI image.
2021-04-28 10:54:22 +02:00
Brian Clozel
e7ff369ded Rename master branch to main 2021-04-28 10:39:30 +02:00
Brian Clozel
e25a8ba485 Update CI pipeline to use registry-image
This prevents docker rate-limiting issues.
2021-04-28 10:25:35 +02:00
Rossen Stoyanchev
00b01ee524 Rename package for GraphQLTester 2021-04-26 21:59:52 +01:00
Rossen Stoyanchev
b6cc9e4dd5 Remove spring-graphql-core module
Move its contents into the spring-graphql module.
2021-04-26 21:55:30 +01:00
Rossen Stoyanchev
403019521c Rename spring-graphql-web to spring-graphql
Re-purpose spring-graphql-web to be more general than just web and add
org.springframework.web as a top-level package for web support.
2021-04-26 21:42:36 +01:00
Rossen Stoyanchev
1e619263d2 Reactor DataFetcher support
Closes gh-47
2021-04-26 10:03:53 +01:00
Rossen Stoyanchev
a57b78e521 Improve GraphQLTester error checking API
This commit introduces a dedicated ErrorSpec with the option to filter
out expected errors through Predicates.
2021-04-20 11:08:01 +01:00
Rossen Stoyanchev
da597bdcbd Merge GraphQL test support
Closes gh-43
2021-04-15 13:04:29 +01:00
Rossen Stoyanchev
0d52bfc207 Update samples to use GraphQLTester
See gh-43
2021-04-15 13:01:19 +01:00
Rossen Stoyanchev
efb72c7d13 Add tests for GraphQLTester
See gh-43
2021-04-15 13:00:52 +01:00
Rossen Stoyanchev
e22d3e8ea4 Add GraphQLTester
See gh-43
2021-04-15 13:00:20 +01:00
Rossen Stoyanchev
645cf21f17 Update dependencies 2021-04-14 21:24:04 +01:00
Rossen Stoyanchev
b35e5f8c2f WebOutput minor updates
Rename "headers" to "responseHeaders" and clarify those work for HTTP
request queries but not for queries over a WebSocket session.

Update getter for response headers to return a read-only wrapper.

Provide only one public constructor without headers.

See gh-42
2021-04-09 13:05:40 +01:00
Rossen Stoyanchev
ddf107f8b1 WebInput minor refactoring
Use getters so the base RequestInput is usable for JSON serialization,
e.g. for the testing support.

Remove WebSocketMessageInput which only had an extra requestId and
add that to WebInput instead.

See gh-42
2021-04-09 13:05:40 +01:00
Rossen Stoyanchev
4a18932941 Revise GraphQLRequestHandler
Rename to GraphQLService to make it more clear it is a layer below
the specific transport such as HTTP endpoints.

Add WebGraphQLService sub-interface for query execution in web
environment with a WebInterceptor chain.

See gh-42
2021-04-09 08:43:57 +01:00
Rossen Stoyanchev
0338607a9b Parameterize GraphQLRequestHandler
This makes the contract more general and applicable to any GraphQL
request, not necessary coupled to HTTP.

Closes gh-42
2021-04-08 20:37:01 +01:00
Rossen Stoyanchev
b378231d39 Add GraphQLRequestHandler
See gh-42
2021-04-08 20:37:01 +01:00
Rossen Stoyanchev
9ceaaf5684 Polishing contribution
Closes gh-37
2021-04-07 14:23:35 +01:00
Andreas Marek
b6f79f212d Only build GraphQL once
See gh-37
2021-04-07 14:23:35 +01:00
Rossen Stoyanchev
3843e83d43 Add tests to webmvc-http sample 2021-03-11 17:13:25 +00:00
Brian Clozel
b48cacb10a Build projects with JDK8 target
Closes gh-36
2021-03-05 15:31:21 +01:00
Brian Clozel
b18df6208f Merge pull request #34 from joshlong/patch-1
Update SampleWiring.java
2021-02-17 10:38:54 +01:00
Josh Long
d4fc091a43 Update SampleWiring.java
I think you meant to say 'ciao'
2021-02-17 00:43:00 -08:00
Rossen Stoyanchev
ba0c426c32 GraphQL endpoints logged on startup
Closes gh-24
2021-02-17 07:40:37 +00:00
Rossen Stoyanchev
4e735f1ca8 Allow HTTP GET and WebSocket to use the same path
Closes gh-30
2021-02-05 21:07:27 +00:00
Brian Clozel
2ebbd464b8 Fix configuration metadata generation
This commit fixes the build configuration for annotation processing.
The configuration metadata is now being generated and packaged with the
starter module.

Fixes gh-33
2021-02-02 15:43:24 +01:00
Brian Clozel
36121f338f Enable WebSocket endpoint with config property
Prior to this commit, the WebSocket endpoint (MVC or WebFlux) would be
enabled by default. In the case of MVC, the presence of
`spring-websocket` and the required dependencies was an additional hint
that could enable/disable this support depending on the application.

This commit changes the websocket path configuration so that it doesn't
hold a default value anymore. Configuring this property will trigger the
WebSocket support.

Right now developers cannot configure it to be the same as the
`spring.graphql.path`, but this will be solved in #30.

This commit also revisits the configuration properties namespace for
clarity, moving the websocket bits under their own section.

Closes gh-31
2021-02-02 15:27:00 +01:00
Brian Clozel
5696b8cead Configure WebInterceptors in handlers
This commit gathers `WebInterceptor` beans from the context (in an
ordered fashion) and configures them on the relevant GraphQL handlers.

Closes gh-7
2021-02-02 13:53:53 +01:00
Brian Clozel
2990df6c43 Guard MVC auto-configuration with WebSocket classes
This commit ensures that the WebSocket auto-configuration is guarded
with class conditions on WebSocket classes (from the javax API and the
spring-websocket artifact).

This prevents issues where application without such dependencies are
failing at startup.
2021-02-02 10:03:43 +01:00
Rossen Stoyanchev
abad0e1b80 Update graphql-spring-boot-starter test dependencies 2021-02-02 08:08:52 +00:00
Andreas Marek
6440b8b0c9 Upgrade GraphQL Java to 16.2
Closes gh-29
2021-02-02 08:08:52 +00:00
Rossen Stoyanchev
2f52e35050 Support for subscriptions with WebMvc and spring-websocket 2021-02-01 22:38:52 +00:00
Rossen Stoyanchev
63dc81c922 Polishing and minor fix to remove Subscription 2021-02-01 22:17:27 +00:00
Rossen Stoyanchev
49c5caf71d Add rejection for apollographql/subscriptions-transport-ws 2021-01-19 21:17:02 +00:00
Rossen Stoyanchev
c82171897e Polishing 2021-01-19 21:15:22 +00:00
Andreas Marek
19f2693bdf schema is not needed if the top level types are named Query/Mutation/Subscription 2021-01-19 07:36:59 +00:00
Andreas Marek
5ccacd1bb4 use the more idiomatic Query type instead QueryType 2021-01-18 21:35:36 +00:00
Rossen Stoyanchev
ef33e5ea52 Minor refactoring in WebSocketMessageInput
Decouple from HandshakeInfo which is WebFlux specific.
Rename the class to WebSocketMessageInput since it's per message.
Use more specific name for id field based on the protocol.
2021-01-18 21:33:10 +00:00
Rossen Stoyanchev
5a77b93671 Minor refactoring in GraphQLWebSocketHandler
The subscriptions map is now per session and not global.
The rest is polishing.
Minor refactoring
2021-01-18 21:33:10 +00:00
Andreas Marek
b1a11973c4 upgrade to graphql java 16.1
Closes gh-25
2021-01-18 08:37:13 +00:00
Rossen Stoyanchev
bbb0d98511 Complete fix for "connection_init" not having id
Closes gh-27
2021-01-17 22:05:33 +00:00
Andreas Marek
edcd801c8c id is not required on every message (notably init) 2021-01-17 09:38:40 +11: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
Brian Clozel
3e8027a0ca Upgrade to Spring Boot 2.4.1 2021-01-05 13:12:47 +01:00
Brian Clozel
c6d75f57d7 Load GraphQL schema as a Resource 2021-01-05 11:20:05 +01:00
Rossen Stoyanchev
63065d4e8e Create webflux and webmvc sub-packages under ~.graphql
Allows simpler and consistent names for HTTP and WebSocket handler
classes for webmvc and webflux.
2021-01-03 21:40:23 +00:00
Rossen Stoyanchev
35c2068bdf Rename webmvc-http-endpoint to webmvc-http 2021-01-03 21:40:23 +00:00
Rossen Stoyanchev
2e32a06a55 Update to latest GraphQL over WebSocket protocol 2021-01-03 21:40:19 +00:00