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 Details

    • operationName

      T operationName(@Nullable String name)
      Set the operation name.
      Parameters:
      name - the operation name
      Returns:
      this request spec
    • variable

      T variable(String name, @Nullable Object value)
      Add a variable.
      Parameters:
      name - the variable name
      value - the variable value, possibly null since GraphQL supports providing null value vs not providing a value at all.
      Returns:
      this request spec
    • extension

      T extension(String name, @Nullable Object value)
      Add a value for a protocol extension.
      Parameters:
      name - the protocol extension name
      value - the extension value
      Returns:
      this request spec
    • 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).