https://github.com/wednesday-solutions/graphql-testkit
A utility tool that generates a postman collection with all the mutations and queries that your GraphQL endpoint exposes.
https://github.com/wednesday-solutions/graphql-testkit
cli graphql javascript postman test tooling
Last synced: 5 months ago
JSON representation
A utility tool that generates a postman collection with all the mutations and queries that your GraphQL endpoint exposes.
- Host: GitHub
- URL: https://github.com/wednesday-solutions/graphql-testkit
- Owner: wednesday-solutions
- License: mit
- Created: 2021-05-19T16:21:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-18T07:09:05.000Z (over 1 year ago)
- Last Synced: 2025-09-29T10:57:04.093Z (6 months ago)
- Topics: cli, graphql, javascript, postman, test, tooling
- Language: JavaScript
- Homepage: https://wednesday.is/building-products/?utm_source=github&utm_medium=graphql-testkit
- Size: 25.2 MB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GraphQL Testkit
> A utility tool that generates a postman collection with all the mutations and queries that your GraphQL endpoint exposes.

## Install
```sh
// with npm
npm install -g graphql-testkit
// with yarn
yarn global add graphql-testkit
```
## Working Demo

## Usage
```
graphql-testkit \
--endpoint=https://api.spacex.land/graphql\
--header="Authorization:123,x-ws-system-id=10" \
--maxDepth=4
```
- ### endpoint (Required)
The GraphQL endpoint that you want to generate the postman collection for
- ### header (optional)
Comma separated list of http headers that you need to send to you GraphQL API.
- ### maxDepth (optional)
The maximum you want to nest the generated queries and mutations. Default value is 4
- ### outputDirectory (optional)
The directory where the output is saved. Default value is "./output"
## Output
An output directory is created in the `outputDirectory` directory.
A folder structure based on endpoint will be created, which will contain the Postman collection(collections.json)
### For example
endpoint=https://api.spacex.land/graphql
Output Directory
```
${outputDirectory}/api.spacex.land/graphql/collections.json
```
## License
[MIT](LICENSE)