https://github.com/oct8cat/graphql-introspect
https://github.com/oct8cat/graphql-introspect
graphql graphql-introspection graphql-schema
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/oct8cat/graphql-introspect
- Owner: oct8cat
- Created: 2017-05-21T22:11:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-22T01:25:06.000Z (about 8 years ago)
- Last Synced: 2025-03-18T09:49:02.436Z (2 months ago)
- Topics: graphql, graphql-introspection, graphql-schema
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# graphql-introspect
CLI tool for building GraphQL schemas representation in the Schema Language format
from [GraphQLSchema](http://graphql.org/graphql-js/type/#graphqlschema) object
or GraphQL server URL.[](https://app.wercker.com/project/byKey/e590361ccce6a245df73e8776c86d2f6)

## Installation
```
npm install -g graphql-introspect
```## Usage
### Using remote GraphQL server URL
```
$ graphql-introspect http://example.com/graphql
```### Using local schema module
```
$ graphql-introspect /path/to/schema.js
```(See an example of local schema module in `test/schema.js`)
## Output
`graphql-introspect` writes its output to `STDOUT`. To save a schema to a file
use output redirection:```
$ graphql-introspect /path/to/schema.js > /path/to/schema.graphql
```## API
```javascript
const {
introspect,
introspectURL,
introspectFile
} = require('graphql-introspect')introspect('http://example.com/graphql').then(out => {...}).catch(err => {...})
// Same as
introspectURL('http://example.com/graphql').then(out => {...}).catch(err => {...})introspect('/path/to/schema.js').then(out => {...}).catch(err => {...})
// Same as
introspectFile('/path/to/schema.js').then(out => {...}).catch(err => {...})
```