Skip to content

Pass operations to check command #416

@tusharmath

Description

@tusharmath

Problem
As a user I wish to validate the generated graphql schema with a set of graphQL queries.

Solution 1
Since #438 we now support loading multiple graphQL files. Which means that we can pass the queries as a part of the configurations more easily. We should just validate the queries that are in the graphQL files without and special check parameter.

The command would look a lot simpler now:

tc check ./jsonplaceholder.graphql query1.graphql query2.graphql

All the above options should be allowed to test the graphQL schema against the provided queries and mutations.

Solution 2
We will extend the check command on the CLI to support checking of the schema against provided queries and mutations:

# using operation parameter
tc check ./jsonplaceholder.graphql --operation query1.graphql --operation mutation1.graphql

# using comma as a delimiter
tc check ./jsonplaceholder.graphql --operation file1.graphql,file2.graphql

# using space as a delimeter
tc check ./jsonplaceholder.graphql --operation file1.graphql file2.graphql

All the above options should be allowed to test the graphQL schema against the provided queries and mutations.

Technical Requirements

  • Use ValidationError to capture and display all the errors.
  • Errors should be composed with errors from_config.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions