Class GraphQLResponse

Namespace
ProtoTest.GraphQL
Assembly
ProtoTest.GraphQL.dll
public sealed class GraphQLResponse : IDisposable
Inheritance
GraphQLResponse
Implements
Inherited Members
Extension Methods

Properties

Content

public string Content { get; }

Property Value

string

Data

public JsonElement? Data { get; }

Property Value

JsonElement?

ElapsedTime

public TimeSpan ElapsedTime { get; }

Property Value

TimeSpan

Errors

public IReadOnlyList<GraphQLError> Errors { get; }

Property Value

IReadOnlyList<GraphQLError>

Extensions

public JsonElement? Extensions { get; }

Property Value

JsonElement?

HasData

public bool HasData { get; }

Property Value

bool

HasErrors

public bool HasErrors { get; }

Property Value

bool

HttpStatusCode

public HttpStatusCode HttpStatusCode { get; }

Property Value

HttpStatusCode

RawResponse

public HttpResponseMessage RawResponse { get; }

Property Value

HttpResponseMessage

SelectedData

The selected root-field value for shape-driven operations; otherwise the complete data object.

public JsonElement? SelectedData { get; }

Property Value

JsonElement?

Should

Positive assertions on this response, such as Should.HaveHttpStatus(...).

public GraphQLAssertions Should { get; }

Property Value

GraphQLAssertions

ShouldNot

Assertions that must not hold, such as ShouldNot.HaveHttpStatus(...). Error and shape assertions keep their own positive and negative forms.

public GraphQLAssertions ShouldNot { get; }

Property Value

GraphQLAssertions

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ReadDataAs<T>(JsonSerializerOptions?)

public T? ReadDataAs<T>(JsonSerializerOptions? options = null)

Parameters

options JsonSerializerOptions

Returns

T

Type Parameters

T

ShouldHaveError(string)

public GraphQLResponse ShouldHaveError(string code)

Parameters

code string

Returns

GraphQLResponse

ShouldHaveErrors()

public GraphQLResponse ShouldHaveErrors()

Returns

GraphQLResponse

ShouldHaveNoErrors()

public GraphQLResponse ShouldHaveNoErrors()

Returns

GraphQLResponse

ShouldMatchShape(object, JsonSerializerOptions?)

public GraphQLResponse ShouldMatchShape(object expectedShape, JsonSerializerOptions? options = null)

Parameters

expectedShape object
options JsonSerializerOptions

Returns

GraphQLResponse