Commit Graph

263 Commits

Author SHA1 Message Date
rstoyanchev
8549060d19 Add start and stop for RSocket client and tester
Closes gh-378
2022-05-06 11:17:53 +01:00
rstoyanchev
5b59e51bab Add @LocalContextValue and resolver
@ContextValue checks in the main context.
@LocalContextValue checks in the local context.

Closes gh-353
2022-05-06 11:17:53 +01:00
rstoyanchev
07293abf35 Support Mono argument with @ContextValue
Closes gh-355
2022-05-06 11:17:53 +01:00
Brian Clozel
85ad5bbfb4 Rever to "application/json" as default MIME type
As of #108, the `"application/graphql+json"` media type is supported and
has been made the default.

It seems that it is not ready for adoption now; so while we'll keep
supporting it, this commit reverts back to `"application/json"` as the
default media type for servers and clients.

Closes gh-375
2022-05-04 11:14:10 +02:00
rstoyanchev
ee6115610b HttpGraphQlTransport respects default content-type
Closes gh-359
2022-04-28 21:21:43 +01:00
rstoyanchev
ddc3a1503c FieldAccessException falls back on request errors
A field may be missing not only due to field errors but also due to a
failed request, so the error message should show either, whichever is
not empty.

Closes gh-348
2022-04-28 20:53:19 +01:00
rstoyanchev
5d282fd99e Improve readability of assertion messages
Closes gh-361
2022-04-28 20:42:10 +01:00
rstoyanchev
a3977ba082 Parent/source resolver allows CharSequence and Number
Closes gh-370
2022-04-28 20:37:51 +01:00
rstoyanchev
54b1396f0a Polishing 2022-04-28 20:37:51 +01:00
giger85
a94a0649a2 Fix trivial stuff 2022-04-25 16:11:47 +01:00
rstoyanchev
fdf7ce8062 Option to register data fetchers on GraphQLCodeRegistry
Closes gh-312
2022-04-19 15:14:09 +01:00
rstoyanchev
54d061b218 Extract base GraphQlSource builder
Separate more clearly the SDL builder options from other common options
independent of how GraphQLSchema is created.

See gh-312
2022-04-19 14:51:36 +01:00
rstoyanchev
ddb740898e Expose WebSocket session info in interceptor
Expose information about the WebSocketSession consistently in all
methods of WebSocketGraphQlInterceptor.

See gh-268
2022-04-19 08:39:19 +01:00
rstoyanchev
7044844c52 Polishing tests 2022-04-19 08:39:19 +01:00
rstoyanchev
304fb45fb7 Refine handling of unresolved exceptions
Closes gh-352
2022-04-19 08:39:19 +01:00
rstoyanchev
e3cf655a04 Improve logging in ExceptionResolversExceptionHandler
- Resolved exceptions at DEBUG
- Unresolved at ERROR
- Consistent handling of failure from a resolver

Closes gh-336
2022-04-19 08:39:19 +01:00
rstoyanchev
dbba8b17f8 Uncomment assertion for context propagation
Closes gh-342
2022-04-12 21:23:02 +01:00
rstoyanchev
85dc2e5145 Propagate context in WebMvc GraphQlWebSocketHandler
See gh-342
2022-04-12 10:07:46 +01:00
Brian Clozel
e455ebb3d8 Support application/graphql+json content type
The GraphQL HTTP spec now requires the `"application/graphql+json"`
content type.
This commit applies this type by default in the server and client
implementations. `"application/json"` is still accepted and produced if
requested by clients.

Closes gh-108
2022-04-04 13:34:18 +02:00
rstoyanchev
696f2cd02f Refine documentSource locations
Closes gh-338
2022-04-01 21:39:42 +01:00
rstoyanchev
9289f0a1b5 Add MockExecutionGraphQlService in testFixtures 2022-04-01 06:23:39 +01:00
rstoyanchev
b3f13b978a Refactoring in Client and Tester builder implementations
The default transport-specific client and tester extensions contained
their builder implementations, but it makes more sense the other way
around since the extensions are mainly about the builders they provide.
2022-03-29 14:47:35 +01:00
rstoyanchev
8100650183 Improve RSocket tests and minor refactoring
See gh-339
2022-03-29 11:49:19 +01:00
rstoyanchev
5b93c1fce7 RSocket support for SubscriptionErrorException
See gh-339
2022-03-28 09:13:51 +01:00
rstoyanchev
3090328666 Insert WebSocket in the names of GraphQlMessage[Type]
Those are specific to the GraphQL over WebSocket protocol.

See gh-339
2022-03-28 09:08:58 +01:00
rstoyanchev
eb9a369f00 Rename ~.web package to ~.server
Now that RSocket is included, it's more obvious it's not just web.

See gh-339
2022-03-28 09:07:47 +01:00
rstoyanchev
6584b88301 Shorten names of [Web|RSocket]GraphQlHandlerInterceptor
See gh-339
2022-03-28 09:07:11 +01:00
rstoyanchev
36425afb0e Add interception for RSocket handler
See gh-339
2022-03-28 09:06:11 +01:00
rstoyanchev
1462050005 Add RSocketGraphQlClient and GraphQlRSocketHandler
See gh-339
2022-03-28 09:05:40 +01:00
rstoyanchev
0e2c5be01b Minor refactoring
Avoid creating a map for a nested list.

See gh-280
2022-03-22 14:22:05 +00:00
rstoyanchev
fc1e05bbf0 Fix variable names following recent rename 2022-03-22 14:22:05 +00:00
rstoyanchev
7e43223031 Polishing
See gh-280
2022-03-22 12:33:49 +00:00
rstoyanchev
0ecf921ce9 GraphQlArgumentInitializer support for BindException
GraphQlArgumentInitializer now keeps track of the argument path and
accumulates binding errors whose field set to the argument path.

In case of a binding error, it continues with other constructor args
or list elements, accumulating as many errors as possible, and raising
a BindingException at the end.

Closes gh-280
2022-03-22 11:31:22 +00:00
rstoyanchev
98b70c3afe Polishing 2022-03-22 04:17:48 +00:00
rstoyanchev
09a12586e7 Polishing 2022-03-21 17:42:33 +00:00
rstoyanchev
1f53a555da Polishing 2022-03-21 17:37:25 +00:00
rstoyanchev
83001522f6 Refactoring in DefaultGraphQlTester
Align with similar changes in GraphQlClient.
2022-03-21 15:04:53 +00:00
rstoyanchev
3d638918f4 Polishing
Closes gh-327
2022-03-21 10:05:28 +00:00
rstoyanchev
dfff40085c Rename [Web|Socket]Interceptor
Use more qualified names [Web|Socket]GraphQlHandlerInterceptor to
differentiate with ClientGraphQlInterceptor and to align with other
types in the same package.
2022-03-21 09:04:52 +00:00
rstoyanchev
c0f97d3f9b Move WebInterceptorChain into WebInterceptor
Shorter name on method declaration within the interceptor, also for
consistency with GraphQlClientInterceptor.
2022-03-21 04:27:24 +00:00
rstoyanchev
bb6280863a Update documentation for client interception
See gh-322
2022-03-21 04:27:06 +00:00
rstoyanchev
f54ee52d62 Add WebSocketGraphQlClientInterceptor
See gh-322
2022-03-21 04:26:39 +00:00
rstoyanchev
92547de5d0 Add client side interception
Closes gh-332
2022-03-21 04:25:54 +00:00
rstoyanchev
91e7f285fa Shorten GraphQlResponse[Field|Error] and rename GraphQlService
Rename GraphQlService to ExecutionGraphQlService following the renaming
of the request and response to ExecutionGraphQl[Request|Response].

See gh-332
2022-03-21 04:23:59 +00:00
rstoyanchev
67711f7331 Rename Web[Input|Output] to WebGraphQl[Request|Response]
See gh-332
2022-03-21 04:23:34 +00:00
rstoyanchev
182e9e66f0 Extract ExecutionGraphQl[Request|Response] interfaces
Rename the implementation classes Request[Input|Output] accordingly to
match the interfaces, and move them into the support package.

Create AbstractGraphQlResponse in the support package that
pre-implements response field access.

This leaves mainly contracts in the top-level package.

See gh-332
2022-03-21 04:22:01 +00:00
rstoyanchev
be05b031d6 Extract GraphQlRequest interface
See gh-332
2022-03-21 04:21:33 +00:00
rstoyanchev
08597c9e8a Recreate SimpleTypeConverter if ConversionService not set
Closes gh-315
2022-03-21 04:21:02 +00:00
rstoyanchev
982cbbaa45 Extract GraphQlResponseField in the top-level package
GraphQlResponseField is now extracted as a super type at the top-level
package and is exposed from GraphQlResponse. ClientGraphQlResponseField
extends this to provide decoding options.

The change ensures consistency with both GraphQlResponseField and
GraphQlResponseError accessible through GraphQlResponse, also making
both available for client and server side handling.

See gh-10
2022-03-18 18:19:15 +00:00
rstoyanchev
cdd8b67fed Refine GraphQlResponseField getError()
Instead of a simple check, looking for an associated field error at or
above the field, this method now more focused on finding the reason for
a failure when the field has no value.

This allows performing a more thorough search including cases when the
field error is at, above, or even below (e.g. non-null nested field
that bubbled up), in the end falling back on request errors (e.g.
failed response without any field errors).

Also, rename ResponseField to GraphQlResponseField and move to a
top-level class.

See gh-10
2022-03-18 18:19:15 +00:00