![]() Defaults to the provided ApolloRequestBod圜reator implementation. Defaults to false.Īn object conforming to the RequestBod圜reator protocol to assist with creating the request body. True if when an Auto-Persisted query is retried, it should use GET instead of POST to send the query. True if Queries should use GET instead of POST for HTTP requests. True if Auto-Persisted Queries should be used. The version of the client to send with the "apollographql-client-version" headerĪny additional headers you wish to add by default to this request Using Postmans built-in support for GraphQL Using JSON in the request body Using a GraphQL content type header Importing the query as a cURL request. The name of the client to send with the "apollographql-client-name" header A unique identifier for this request, to help with deduping cache hits for watchers. The endpoint to make a GraphQL request to requestBod圜reator: An object conforming to the RequestBod圜reator protocol to assist with creating the request body.useGETForPersisted Query Retry: true if when an Auto- Persisted query is retried, it should use GET instead of POST to send the query.useGETForQueries: true if Queries should use GET instead of POST for HTTP requests.autoPersistQueries: true if Auto- Persisted Queries should be used.cachePolicy: The CachePolicy to use for this request.additionalHeaders: Any additional headers you wish to add by default to this request.clientVersion: The version of the client to send with the "apollographql-client-version" header.clientName: The name of the client to send with the "apollographql-client-name" header The possibility of defining JSON objects as fields of a type in a GraphQL schema has been explained in the schema reference.contextIdentifier: A unique identifier for this request, to help with deduping cache hits for watchers.graphQL Endpoint: The endpoint to make a GraphQL request to.operation : The GraphQL Operation to execute.ExposeExtensions when disabled hides the entire extensions property, including code, codes,Īnd data (if enabled).ExposeData when enabled sets the extension's data property to equal the data within the error'sĭata property.That has an inner exception of type ArgumentNullException would contain a codes property So an ExecutionError with a code of INVALID_FORMAT UPPER_CASE and removing the "Extension" suffix). The error's Code property, if any, and the type name of inner exceptions (after being converted to ExposeCodes when enabled sets the extensions's codes property to equal a list containing both.ExposeCode when enabled sets the extensions's code property to equal the error's Code. ![]() ToString() method, which includes a stack trace. ExposeExceptionStackTrace when enabled sets the message property for errors to equal theĮxception's.IErrorInfoProvider) contains 5 properties to control serialization behavior: The ErrorInfoProvider class (default implementation of To the constructor of the document writer. ![]() Serialization of ExecutionErrors into the resulting json data by providing an IErrorInfoProvider The GraphQL spec allows for four properties to be returned within eachĮrror: message, locations, path, and extensions. WriteToStringAsync (result ) Error Serialization Within your dependency injection framework, if applicable. This class is designed to be registered as a singleton Other types define the objects and fields that the. The root type of a GraphQL schema, Query by default, contains all of the fields that can be queried. The server returns a result that mirrors the shape of the original query, typically as JSON. Handles constructing the options, registering the converter, and serializing a specifiedĮxecutionResult to a data stream. After being validated against the schema, a GraphQL query is executed by the server. To assist, a DocumentWriter class is provided with a single method, WriteAsync, which The converter can be registered within an instance of JsonSerializerOptions so that serializing anĮxecutionResult produces the proper output. Serialization of a ExecutionResult object is handled by ExecutionResultJsonConverter which accepts in itsĬonstructor an instance of IErrorInfoProvider (see Error Serialization below). A sample of the required configuration is below: ![]() Reading and writing of the underlying stream. Significant when hosting the service via ASP.NET Core, as it is required to deliberately allow synchronous Helper actually performs synchronous calls on the underlying stream when writing the JSON output. Due to this reason, the async GraphQL.NewtonsoftJson serialization Serialization or deserialization methods. First, the Newtonsoft.Json library does not provide asynchronous There are two notableĭifferences between the two serialization engines. These two projects have very similar classes and extension methods available. GraphQL.NewtonsoftJson, for use with the Newtonsoft.Json library.GraphQL.SystemTextJson, for use with the library, and.Request or response format, but it is common to do so. Two libraries are available for assistance deserializing JSON-formatted GraphQL requests,Īnd serializing GraphQL responses in a JSON format.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |