graphql-js-tree
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

npm Commitizen friendly npm downloads

Simplier approach to GraphQL parsing. Using graphql-js library and parsing AST to simplier types. It is a backbone of graphql-zeus and graphql-editor

How it works

SDL GraphQL

It creates very simple ParserTree from GraphQL schema

import { Parser, TreeToGraphQL } from 'graphql-js-tree';

const schemaFileContents = `
type Query{
    hello: String!
}
schema{
    query: Query
}
`;

const parsedSchema = Parser.parse(schemaFileContents);

// Backwards

const graphqlString = TreeToGraphQL.parse(parsedSchema);

GQL

import { parseGql } from 'graphql-js-tree';

const schemaFileContents = `
type Query{
    hello: String!
}
schema{
    query: Query
}
`;

const gqlQuery = `
    query MyQuery{
        hello
    }
`;

const parsedTrees = parseGql(gqlQuery, schemaFileContents);

// Backwards

const gqlString = parseGqlTrees(parsedTrees);

Table of contents

License

MIT

Support

Join our GraphQL Editor Channel

Leave a star ;)

Contribute

For a complete guide to contributing to GraphQL Editor, see the Contribution Guide.

  1. Fork this repo
  2. Create your feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.24,253latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.24,253
3.0.127
3.0.00
2.0.284
2.0.10
2.0.00
1.0.95,400
1.0.82
1.0.70
1.0.61,010
1.0.51,192
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.4.0188
0.3.927
0.3.80
0.3.70
0.3.60
0.3.50
0.3.40
0.3.30
0.3.20
0.3.17
0.3.00
0.2.8183
0.2.70
0.2.60
0.2.50
0.2.40
0.2.30
0.2.20
0.2.10
0.2.00
0.1.9125
0.1.826
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.1123
0.1.00
0.0.3107
0.0.219
0.0.112

Package Sidebar

Install

npm i graphql-js-tree

Weekly Downloads

12,785

Version

3.0.2

License

MIT

Unpacked Size

132 kB

Total Files

82

Last publish

Collaborators

  • slothking