The Protevus Platform: Unified Full-Stack Development https://protevus.com
Find a file
2017-07-04 13:32:52 -04:00
.idea Almost done with fields... 2017-07-04 11:58:22 -04:00
example Variable also work 2017-07-03 11:53:19 -04:00
lib Just need doc and top-level defs 2017-07-04 13:32:52 -04:00
test Just need doc and top-level defs 2017-07-04 13:32:52 -04:00
.analysis-options argument+directive 2017-07-03 19:03:36 -04:00
.gitignore Values done 2017-07-03 11:37:35 -04:00
.travis.yml Values done 2017-07-03 11:37:35 -04:00
LICENSE Initial commit 2017-01-20 15:42:02 -05:00
pubspec.yaml Values done 2017-07-03 11:37:35 -04:00
README.md Values done 2017-07-03 11:37:35 -04:00

graphql_parser

Pub build status

Parses GraphQL queries and schemas.

This library is merely a parser. Any sort of actual GraphQL API functionality must be implemented by you, or by a third-party package.

Angel framework users should consider package:angel_graphql as a dead-simple way to add GraphQL functionality to their servers.

Installation

Add graphql_parser as a dependency in your pubspec.yaml file:

dependencies:
  graphql_parser: ^1.0.0

Usage

The AST featured in this library is directly based off this ANTLR4 grammar created by Joseph T. McBride: https://github.com/antlr/grammars-v4/blob/master/graphql/GraphQL.g4

import 'package:graphql_parser/graphql_parser.dart';

doSomething(String text) {
  var tokens = scan(text);
  var parser = new Parser(tokens);
  
  // Parse the GraphQL document using recursive descent
  var doc = parser.parseDocument();
  
  // Do something with the parsed GraphQL document...
}