Skip to content
On this page

Empower Your Test Results with AI-Powered Insights ->

withGraphQLVariables

Represents GraphQL variables.

Syntax

js
withGraphQLVariables(variables)

Usage

โœ… Correct Usage

js
await spec()
  .post('/api/users')
  .withGraphQLQuery(`
    query HeroNameAndFriends($episode: Episode) {
      hero(episode: $episode) {
        name
        friends {
          name
        }
      }
    }
  `)
  .withGraphQLVariables({
    "episode": "JEDI"
  })
  .expectStatus(201);

Arguments

> variables (object)

GraphQL variables.

Released under the MIT License.