Class GraphQLRequestBuilder

Namespace
ProtoTest.GraphQL
Assembly
ProtoTest.GraphQL.dll
public sealed class GraphQLRequestBuilder
Inheritance
GraphQLRequestBuilder
Inherited Members
Extension Methods

Methods

Auth(IProtoHttpAuthenticator)

public GraphQLRequestBuilder Auth(IProtoHttpAuthenticator authenticator)

Parameters

authenticator IProtoHttpAuthenticator

Returns

GraphQLRequestBuilder

Auth<TAuthenticator>(params object[])

public GraphQLRequestBuilder Auth<TAuthenticator>(params object[] constructorArgs) where TAuthenticator : class, IProtoHttpAuthenticator

Parameters

constructorArgs object[]

Returns

GraphQLRequestBuilder

Type Parameters

TAuthenticator

ConnectionPayload(object)

Sets the optional graphql-transport-ws connection_init payload.

public GraphQLRequestBuilder ConnectionPayload(object payload)

Parameters

payload object

Returns

GraphQLRequestBuilder

ExecuteAsync(CancellationToken)

public Task<GraphQLResponse> ExecuteAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<GraphQLResponse>

ExpectAsync<TShape>(TShape, CancellationToken)

Selects, executes, and matches one root field using the same response shape.

public Task<GraphQLResponse> ExpectAsync<TShape>(TShape expectedShape, CancellationToken cancellationToken = default)

Parameters

expectedShape TShape
cancellationToken CancellationToken

Returns

Task<GraphQLResponse>

Type Parameters

TShape

Header(string, string)

public GraphQLRequestBuilder Header(string name, string value)

Parameters

name string
value string

Returns

GraphQLRequestBuilder

Mutation(string?, Action<GraphQLOperationBuilder>)

public GraphQLRequestBuilder Mutation(string? name, Action<GraphQLOperationBuilder> configure)

Parameters

name string
configure Action<GraphQLOperationBuilder>

Returns

GraphQLRequestBuilder

Mutation(string, object?, string?)

Starts a shape-driven mutation for one root field.

public GraphQLRequestBuilder Mutation(string rootField, object? arguments = null, string? operationName = null)

Parameters

rootField string
arguments object
operationName string

Returns

GraphQLRequestBuilder

Query(string?, Action<GraphQLOperationBuilder>)

public GraphQLRequestBuilder Query(string? name, Action<GraphQLOperationBuilder> configure)

Parameters

name string
configure Action<GraphQLOperationBuilder>

Returns

GraphQLRequestBuilder

Query(string, object?, string?)

Starts a shape-driven query for one root field.

public GraphQLRequestBuilder Query(string rootField, object? arguments = null, string? operationName = null)

Parameters

rootField string
arguments object
operationName string

Returns

GraphQLRequestBuilder

Request(string, string?)

public GraphQLRequestBuilder Request(string document, string? operationName = null)

Parameters

document string
operationName string

Returns

GraphQLRequestBuilder

Select<TShape>()

Derives the GraphQL selection set from a test-owned contract type.

public GraphQLRequestBuilder Select<TShape>()

Returns

GraphQLRequestBuilder

Type Parameters

TShape

Select<TShape>(TShape)

Derives the GraphQL selection set from an anonymous object or test-owned contract.

public GraphQLRequestBuilder Select<TShape>(TShape selectionShape)

Parameters

selectionShape TShape

Returns

GraphQLRequestBuilder

Type Parameters

TShape

SubscribeAsync(CancellationToken)

public Task<GraphQLSubscription> SubscribeAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<GraphQLSubscription>

Subscription(string?, Action<GraphQLOperationBuilder>)

public GraphQLRequestBuilder Subscription(string? name, Action<GraphQLOperationBuilder> configure)

Parameters

name string
configure Action<GraphQLOperationBuilder>

Returns

GraphQLRequestBuilder

Subscription(string, object?, string?)

Starts a shape-driven subscription for one root field.

public GraphQLRequestBuilder Subscription(string rootField, object? arguments = null, string? operationName = null)

Parameters

rootField string
arguments object
operationName string

Returns

GraphQLRequestBuilder

Variables(object)

public GraphQLRequestBuilder Variables(object variables)

Parameters

variables object

Returns

GraphQLRequestBuilder

WithoutAuth()

public GraphQLRequestBuilder WithoutAuth()

Returns

GraphQLRequestBuilder