You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Introduction

This tool validates GraphQL queries against a schema defined using Schema Definition Language (SDL) so that callers know they need to update their GraphQL queries and their GraphQL responders to match the current schema.You can use GraphQL Query Validators as standalone tools to manually validate GraphQL queries or connect it to tools that send or receive messages in GraphQL format to verify that the queries are valid. See Validating Incoming Requests for an example of using validators like this one in a common workflow.

Attaching a GraphQL Query Validator to Existing Tools

You can attach a GraphQL Query Validator tool to test clients, PVA responders, or other tools that exchange data in GraphQL format.

  1. Right-click on a tool and choose Add Output...
  2. Select the traffic option you want to validate and choose GraphQL Query Validator then click Finish.

  3. Enter the location or URL of an SDL or an introspection URL in the GraphQL SDL or Introspection URL field. You can also click Browse to navigate to a local SDL file.
    • You can also reference an environment variable using the ${variable-name} syntax if it's defined in the suite. The resolved URL will be displayed when referencing the variable.
  4. Enable Persist as Relative Path if you want the path to this file to be saved as a path that is relative to the current configuration file.

When the client executes, an error will be reported if a query does not conform to the SDL.

Using a Standalone GraphQL Query Validator

  1. Right-click on a Test Suite and choose Add New > Test.
  2. Select the type of test you want to validate and choose GraphQL Query Validator then click Finish.
  3. Enter the location or URL of an SDL or an introspection URL in the GraphQL SDL or Introspection URL field. You can also click Browse to navigate to a local SDL file.
    • You can also reference an environment variable using the ${variable-name} syntax if it's defined in the suite. The resolved URL will be displayed when referencing the variable.
  4. Enable Persist as Relative Path if you want the path to this file to be saved as a path that is relative to the current configuration file.
  5. Click the Input tab and either choose the Text or File option to specify the incoming payload. 
  6. Save your changes.

When the client executes, an error will be reported if a query does not conform to the SDL.

  • No labels