Commit Graph

58 Commits

Author SHA1 Message Date
rstoyanchev
88d7ea7894 Pass localContext only if available
See gh-1066
2024-10-21 18:31:47 +01:00
Brian Clozel
d7ed85045b Produce INTERNAL_ERROR observation outcome
Prior to this commit, the `DefaultExecutionRequestObservationConvention`
would only produce "INTERNAL_ERROR" outcomes if the response is null or
if an unresolved exception remains.

The `ExceptionResolversExceptionHandler` will catch all unresolved
exceptions and add them to the errors map with the
`ErorType.INTERNAL_ERROR` error type. This means that the
"INTERNAL_ERROR" outcome is never used.

This commit ensures that this outcome is also used if at least one
resolved error is of `ErorType.INTERNAL_ERROR`.

Fixes gh-1058
2024-10-09 12:25:01 +02:00
rstoyanchev
ba1dcf0baf Document behavior when "first" and "last" present
Closes gh-1055
2024-09-16 12:08:37 +01:00
rstoyanchev
71b709253d Polishing documentation on pagination
See gh-1055
2024-09-16 12:07:38 +01:00
Brian Clozel
1979e435c3 Upgrade to GraphQL Java 22.2
This also documents the new subscription ordering feature as reported
and requested in #949.

Closes gh-1044
2024-08-21 18:12:48 +02:00
Brian Clozel
311531b74f Move client and testing docs to compiled code snippets
Prior to this commit, the "client" and "testing" sections of the
reference documentation were using inline code snippets.
Because of this, several snippets were out of date or invalid.

This commit moves all those code snippets to actual Java classes
compiled with the documentation.

Fixes gh-1042
2024-08-21 10:44:54 +02:00
Brian Clozel
c1ed773cc7 Document minimum standalone setup for GraphQL support
Most Spring for GraphQL applications use Spring Boot as a way to
auto-configure the required infrastructure for running GraphQL
applications.

This commit documents a minimal setup for Spring applications not
relying on Spring Boot. This assumes an existing infrastructure for a
Spring MVC application.

Closes gh-606
2024-07-12 16:06:48 +02:00
Hantsy Bai
1dcc2ddc3a Update transports.adoc
fix `GraphQlWebFluxAutoConfiguration` format in websocket section.
2024-06-25 09:54:56 +01:00
Brian Clozel
6e155c0321 Update reference doc links to Spring Boot 3.3.x
Closes gh-1016
2024-06-20 09:57:58 +02:00
Brian Clozel
a9a8d0b745 Add fragments support in GraphQlTester
This commit adds support for GraphQL fragments with `GraphQlTester`.
Fragments allow to avoid repetition in GraphQL requests by reusing
field selection sets.

For example, the "releases" fragment can be reused in multiple queries
and make the overall document shorter:

```
query frameworkReleases {
  project(slug: "spring-framework") {
    name
    ...releases
  }
}
query graphqlReleases {
  project(slug: "spring-graphql") {
    name
    ...releases
  }
}

fragment releases on Project {
  releases {
    version
  }
}
```

With this change, `GraphQlTester` accepts fragments as `String` or can
load them by their name using the configured `DocumentSource`, similarly
to the document support.

Closes gh-964
2024-06-03 18:27:19 +02:00
rstoyanchev
c35fc08783 Fix link to samples
See gh-208
2024-05-23 17:27:30 +01:00
rstoyanchev
351ce9fbd5 Update Samples section of reference
See gh-208
2024-05-23 17:14:18 +01:00
rstoyanchev
f9a34efe1f Merge branch '1.2.x' 2024-05-18 13:08:08 +01:00
rstoyanchev
aa1ee77867 Document how to configure custom ExecutionStrategy
Closes gh-832
2024-05-18 13:05:02 +01:00
rstoyanchev
dd2a3d21d5 Tests and docs for AuthenticationWebSocketInterceptor
Closes gh-268
2024-05-17 14:18:58 +01:00
rstoyanchev
f4c6fca42f Update docs for blocking controller method support
See gh-958
2024-05-07 17:45:57 +01:00
rstoyanchev
0ab80ee5ce Improve class mapping in SchemaMappingInspector 2024-05-03 20:01:56 +01:00
rstoyanchev
b8c4899475 Update docs for Kotlin method signatures
See gh-954
2024-05-01 08:01:05 +01:00
rstoyanchev
432d982579 Polishing federation section of the reference
See gh-922
2024-04-24 09:33:15 +01:00
Brian Clozel
b8b4774f11 Merge branch '1.2.x' 2024-04-16 17:17:38 +02:00
Brian Clozel
1d98f9b45f Document schema Namespacing with annotated controllers
Closes gh-863
2024-04-16 17:16:44 +02:00
rstoyanchev
31f50752d8 Update docs for batched EntityMapping methods
Closes gh-922
2024-04-15 12:40:03 +01:00
rstoyanchev
3f7e0f1be5 Polishing Federation section in docs 2024-04-15 12:40:03 +01:00
rstoyanchev
d45d31b1f1 Update docs for schema interface mappings
Closes gh-871
2024-04-15 12:40:03 +01:00
rstoyanchev
0b491b9635 Polishing docs 2024-04-15 12:40:03 +01:00
rstoyanchev
b84d521f1d Polishing documentation
See gh-608
2024-04-11 18:00:09 +01:00
Toby
3f5fc1a5b3 Support keepAlive in WebSocket client
See gh-608
2024-04-11 15:09:17 +01:00
rstoyanchev
d31b94ec02 Documentation update in WebSocket section
See gh-534
2024-04-11 14:20:02 +01:00
Brian Clozel
9e4d77395a Configure Jackson codec specifically for GraphQL HTTP endpoints
Prior to this commit, the `GraphQlHttpHandler` implementations would use
the JSON codecs configured in the web Framework (MVC or WebFlux) for
reading and writing GraphQL payloads as JSON documents.

This can cause issues in cases the application configures the JSON codec
in a way that makes it incompatible with the expected GraphQL documents.
For example, not serializing empty values and arrays.

This commit adds new constructors in `GraphQlHttpHandler`
implementations that can get a custom JSON codec for GraphQL payloads.

Closes gh-860
2024-04-02 18:11:35 +02:00
rstoyanchev
1e6a5a09d7 Polishing in SchemaMappingInspector
See gh-934
2024-03-26 10:12:29 +00:00
rstoyanchev
27c44ecef5 Update docs for schema mapping inspection of unions and interfaces
Closes gh-924
2024-03-25 17:10:55 +00:00
rstoyanchev
a18586bed7 Polishing docs on schema mapping inspection
See gh-924
2024-03-25 15:36:20 +00:00
rstoyanchev
d794d373c8 Merge branch '1.2.x' 2024-03-22 17:56:00 +00:00
rstoyanchev
1a3ae735c1 Add Thread Model section to documentation
Closes gh-907
2024-03-22 17:51:51 +00:00
rstoyanchev
7140e6cbae Avoid AssertException for persisted query
Closes gh-930
2024-03-22 13:37:28 +00:00
rstoyanchev
267b514cf2 Schema inspection support for unmapped arguments
Closes: gh-740
2024-03-15 10:01:18 +00:00
rstoyanchev
c5acccf770 Add DgsGraphQlClient
Closes gh-846
2024-02-19 19:41:23 +00:00
Brian Clozel
1f7063c9b4 Add Server-Sent Events transport
Prior to this commit, the WebFlux and WebMVC infrastructure would only
support subscriptions over the WebSocket and RSocket transports.

This commit adds the `GraphQlSseHandler` implementations for both web
frameworks. This handler will send GraphQL responses as as stream of
Server-Sent Events, over an HTTP response with the "text/event-stream"
content type.

This implementation only supports the "Distinct connections mode" and
will reject all operations other than Subscriptions.

This commit also enhances the `HttpGraphQlTransport` client transport to
support subscriptions over this new protocol.

Closes gh-309
2024-02-15 21:09:27 +01:00
Brian Clozel
c55de8d091 Record response errors as events in Request Observations
Prior to this commit, GraphQL Request Observations would not record
errors as Observation errors, because with GraphQL errors can partially
affect the response and there can be multiple. Instead, an invalid
request (for example) would lead to a `"graphql.outcome", "REQUEST_ERROR"`
low cardinality KeyValue. In this case, developers would not know what
type of error occured nor if there were multiple.

This commit records all errors listed in the GraphQL as
Observation.Event on the request Observation. Such events are usually
handled by the tracing handler and are recorded as span annotations for
traces. Other `ObservationHandler` annotations can leverage events in a
different fashion.

Closes gh-859
2024-02-14 14:06:21 +01:00
rstoyanchev
d836f6879e Add documentation for federation support
Closes gh-864
2024-02-06 20:46:59 +00:00
rstoyanchev
87aa98b1d8 Update docs for synchronous GraphQlClient
Closes gh-771
2024-01-31 18:43:34 +00:00
Nils Hartmann
b37a06bf59 ExecutionGraphQlService instead of GraphqlService
See gh-877
2024-01-26 09:59:53 +00:00
rstoyanchev
b326771f9e Update section on code generation
Closes gh-847
2023-12-07 10:16:40 +00:00
rstoyanchev
779cc761ba Add reference docs section on codegen
Closes gh-847
2023-11-20 21:37:57 +00:00
Nils Hartmann
80b1c27149 Use ScrollPosition.offset() to get initial scroll position 2023-10-18 16:31:50 +01:00
Simon Verhoeven
e48004f0bf doc: fix method name 2023-09-18 13:09:55 +01:00
Brian Clozel
1032f99b6d Polish
See gh-759
2023-08-21 17:43:40 +02:00
roksui
8038be2796 Change WebGraphQlServiceTester to WebGraphQlTester
Closes gh-759
2023-08-21 17:09:01 +02:00
Rob Winch
29fb3293f2 Fix include-code macro 2023-08-04 15:38:28 +01:00
Rob Winch
9a4b72935d Convert to Asciidoctor Tabs 2023-08-04 15:38:28 +01:00