Interface GraphQlTester.Request<T extends GraphQlTester.Request<T>>
- Enclosing interface:
- GraphQlTester
public static interface GraphQlTester.Request<T extends GraphQlTester.Request<T>>
Declare options to gather input for a GraphQL request and execute it.
-
Method Summary
Modifier and TypeMethodDescriptionexecute()
Execute the GraphQL request and return a spec for further inspection of response data and errors.void
Execute the GraphQL request and verify the response contains no errors.Execute the GraphQL request as a subscription and return a spec with options to transform the result stream.Add a value for a protocol extension.operationName
(String name) Set the operation name.Add a variable.
-
Method Details
-
operationName
Set the operation name.- Parameters:
name
- the operation name- Returns:
- this request spec
-
variable
Add a variable.- Parameters:
name
- the variable namevalue
- the variable value, possiblynull
since GraphQL supports providing null value vs not providing a value at all.- Returns:
- this request spec
-
extension
Add a value for a protocol extension.- Parameters:
name
- the protocol extension namevalue
- the extension value- Returns:
- this request spec
-
execute
GraphQlTester.Response execute()Execute the GraphQL request and return a spec for further inspection of response data and errors.- Returns:
- options for asserting the response
- Throws:
AssertionError
- if the request is performed over HTTP and the response status is not 200 (OK).
-
executeAndVerify
void executeAndVerify()Execute the GraphQL request and verify the response contains no errors. -
executeSubscription
GraphQlTester.Subscription executeSubscription()Execute the GraphQL request as a subscription and return a spec with options to transform the result stream.- Returns:
- spec with options to transform the subscription result stream
- Throws:
AssertionError
- if the request is performed over HTTP and the response status is not 200 (OK).
-