GraphQL-to-Postman is a tool by Postman Labs that converts GraphQL schema definitions (SDL) into Postman Collection v2 format. It supports both CLI and programmatic usage, with options for depth, deprecated fields, and interface version selection. Current stable version is 1.0.0. Unlike manual collection creation, this automates the process and ensures the collection matches the schema exactly.
npm install graphql-to-postmanNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a GraphQL schema string into a Postman Collection object using the convert function.
Ensure input is { type: 'graphql', data: schemaString }.Use JSON.stringify(result.collection) when saving.
Omit the -i flag or explicitly set -i v2.
Use require('graphql-to-postman') instead of import.Ensure input object has type and data properties, and await the convert call.