GraphQL Client
The outbound client validates hand-written GraphQL queries against a server's schema and runs them. It ships in three packages. For the concepts (query modes, schema sources, keyed clients), see GraphQL Client.
services
.AddTraxGraphQLClient(new Uri("https://api.example.com/graphql"))
.UseFileSchema("schema.graphql")
.WithStrictness(ResponseStrictness.ThrowOnDrift);Trax.Api.GraphQL.Client
The kernel. It has no dependency on trains, the mediator or a database.
- AddTraxGraphQLClient: registers a client for one endpoint.
- AddKeyedTraxGraphQLClient: registers a client under a DI key.
- TraxGraphQLClientBuilder: schema source, strictness, HTTP client and JSON options.
- ValidateGraphQLClientAssembliesAsync: validates a client's request types after the app is built.
- IGraphQLClientRequest: the request contract.
- GraphQLResourceRequest: a request whose query is an embedded
.graphqlfile. - GraphQLClientAttribute: marks the keyed client a request belongs to.
- IGraphQLClientExecutor: validates, sends and reads a request.
- IGraphQLClientValidator: validates a query, or every request type in a set of assemblies.
- ISchemaProvider: where the schema comes from, and the built-in providers.
- IGraphQLClientConfiguration: the settings a client runs with, and the builder they come from.
- ResponseStrictness: how a response is checked against its response type.
- Client exceptions: what
Runand validation throw.
Trax.Api.GraphQL.Client.Trax
- UseAssemblySchema: validates against the server's HotChocolate schema built in-process.
- UseStartupValidation: validates a client's request types when the host starts.
- TraxOutboundQueryAttribute: names the external endpoint a request calls, with
OutboundQueryDiscovery, which lists them.
Trax.Api.GraphQL.Client.Typed
- TypedRequest: a request whose query is generated from its response type, and the attributes that shape it.