Skip to the content.

< Back


GraphQLClientExtensions

Namespace: GraphQL.Client.Extensions

Extensions for the GraphQL.Client.GraphQLClient class.

public static class GraphQLClientExtensions

Inheritance ObjectGraphQLClientExtensions

Methods

Get<T>(GraphQLClient, IQuery, CancellationToken)

Send a GraphQL.Common.Request.GraphQLRequest via GET.

public static Task<T> Get<T>(GraphQLClient client, IQuery query, CancellationToken cancellationToken)

Type Parameters

T
Data Type.

Parameters

client GraphQLClient
The GraphQL Client.

query IQuery
The query.

cancellationToken CancellationToken
The cancellation token.

Returns

Task<T>

Exceptions

ArgumentException
Dupe Key, missing parts or empty parts of a query

ArgumentNullException
Invalid Configuration

GetBatch(GraphQLClient, IQuery[], CancellationToken)

Send a GraphQL.Common.Request.GraphQLRequest composed of a query batch via GET.

public static Task<IReadOnlyDictionary<string, JToken>> GetBatch(GraphQLClient client, IQuery[] queries, CancellationToken cancellationToken)

Parameters

client GraphQLClient
The GraphQL Client.

queries IQuery[]
The query batch.

cancellationToken CancellationToken
The cancellation token.

Returns

Task<IReadOnlyDictionary<String, JToken>>

Exceptions

ArgumentException
Dupe Key, missing parts or empty parts of a query

ArgumentNullException
Invalid Configuration

Post<T>(GraphQLClient, IQuery, CancellationToken)

Send a GraphQL.Common.Request.GraphQLRequest via POST.

public static Task<T> Post<T>(GraphQLClient client, IQuery query, CancellationToken cancellationToken)

Type Parameters

T
Data Type.

Parameters

client GraphQLClient
The GraphQL Client.

query IQuery
The query.

cancellationToken CancellationToken
The cancellation token.

Returns

Task<T>

Exceptions

ArgumentException
Dupe Key, missing parts or empty parts of a query

ArgumentNullException
Invalid Configuration

PostBatch(GraphQLClient, IQuery[], CancellationToken)

Send a GraphQL.Common.Request.GraphQLRequest composed of a query batch via POST.

public static Task<IReadOnlyDictionary<string, JToken>> PostBatch(GraphQLClient client, IQuery[] queries, CancellationToken cancellationToken)

Parameters

client GraphQLClient
The GraphQL Client.

queries IQuery[]
The query batch.

cancellationToken CancellationToken
The cancellation token.

Returns

Task<IReadOnlyDictionary<String, JToken>>

Exceptions

ArgumentException
Dupe Key, missing parts or empty parts of a query

ArgumentNullException
Invalid Configuration


< Back