Skip to content

symm/graphql-contract-test

Repository files navigation

GraphQL Contract Test

npm version

Consumer driven contract testing for GraphQL APIs.

Usage

  GraphQL Contract Test v0.0.10


  Check if the remote server fulfills the supplied GraphQL contract file

  Usage: graphql-contract-test ENDPOINT_URL client_schema_file

  Options:
    --header, -h         Add a custom header (ex. 'Authorization=Bearer ...'), can be used multiple times
    --ignore-directives  Exclude directive changes from the comparison

Where client-schema.graphql contains the schema you expect the server to implement.

An introspection query will be made against the API, any breaking changes will be reported

Docker Image

Place your schema.graphqls file in the current working directory then exec:

docker run \
    --rm \
    -t \
    -v $(PWD)/schema.graphqls:/schema.graphqls \
    symm/graphql-contract-test:latest \
    https://your-api-here /schema.graphqls