-
Notifications
You must be signed in to change notification settings - Fork 317
Add a GraphQLClient #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
rstoyanchev
added a commit
that referenced
this issue
Feb 24, 2022
Allows some reuse between WebFlux and WebMVC and between client and server. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Feb 24, 2022
Provides support for WebSocket tests without a running server. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Feb 24, 2022
rstoyanchev
added a commit
that referenced
this issue
Feb 24, 2022
rstoyanchev
added a commit
that referenced
this issue
Mar 7, 2022
rstoyanchev
added a commit
that referenced
this issue
Mar 7, 2022
Add HttpGraphQlClient and WebSocketGraphQlClient extensions along with a builder hierarchy that combines GraphQlClient and transport specific configuration. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 7, 2022
Now that transport specific GraphQlClient extensions provide a unified builder for GraphQlClient and transport configuration, the transports become a private implementation detail. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 7, 2022
Add WebGraphQlClient as a common representation for a Web GraphQlClient extension and its builders that has to be started through the HTTP or WebSocket implementations. Remove the common base builder for HTTP and WebSocket, with HTTP simply delegating to the underlying WebClient builder For WebSocket, builder state is exposed from the transport to simplify the mutation logic. DefaultGraphQlClientBuilder is now abstract, leaving subclasses to implement the build method. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 7, 2022
rstoyanchev
added a commit
that referenced
this issue
Mar 7, 2022
As these are expected to be used as local variables, "Spec" reduces readability and the IDE creates variables called "spec", which increases that effect. Given those are nested within `GraphQlClient` and `GraphQlTester`, it makes sense to drop the spec part and local variable names such as request and response make sense. See gh-10, see gh-317
rstoyanchev
added a commit
that referenced
this issue
Mar 7, 2022
rstoyanchev
added a commit
that referenced
this issue
Mar 10, 2022
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2022
Replace the use of ExecutionResult on the client side where we are dealing with a response map rather, and also incorporate it into the server-side hierarchy where it wraps an ExecutionResult instead. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2022
Extends GraphQlResponse with a subtype that exposes further options to handle data and errors in the response from a client perspective. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2022
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2022
Refine exception handling and ensure a hierarchy of exceptions that allows differentiating between transport errors vs field errors while accessing an invalid data or field. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2022
DefaultClientGraphQlResponse now parses the path to a field and creates the same parsed representation as GraphQL Java does and uses for GraphQLError paths. This makes it easier to correlate fields to field errors and eliminates the need for a dependency on JSONPath in the client. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2022
Provides a shortcut alternative to the execute methods, for decoding a single field from the response. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 15, 2022
There are some follow-up tasks like #332 that remain but the |
rstoyanchev
added a commit
that referenced
this issue
Mar 17, 2022
getError now returns either the error at the field or on a parent field, which provides a reliable answer for why a field failed even for a field whose path is below where the error occurred. getErrors likewise now also includes errors above. There is still no need for special logic to get only errors below since where there is a field value, errors are below anyway. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 17, 2022
hasValue is more meaningful because it means valid and with some value that could be decoded, which in turn allows removing Nullable from toEntity/List. Or if there is no value, getError() can be used to differentiate between a failed field vs a null field declared optional. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 18, 2022
If a field is null but without errors, i.e. declared optional in the schema, it is more natural for toEntity to complete empty instead of raising a FieldAccessException. This aligns better with the execute method where handling the field directly allows treating a null but valid field as optional. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 18, 2022
MapGraphQlResponse is a simple wrapper around the response map exposing it as GraphQlResponse. It is now package private and made accessible through a static factory method on GraphQlTransport. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 18, 2022
This allows exposing additional conveniences for inspecting errors. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 18, 2022
Add a String path representation making it easy to filter errors by path using String comparison, and refine nullability. Take advantage of the String error paths to simplify internal filtering of error fields. See gh-10
rstoyanchev
added a commit
that referenced
this issue
Mar 18, 2022
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
rstoyanchev
added a commit
that referenced
this issue
Mar 18, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Like RestTemplate, WebClient, WebSocketClient, RSocketRequestor, add a Client to simplify the Client/Server communications using GraphQL-based APIs.
The text was updated successfully, but these errors were encountered: