graphql (version 1.5)

graphql2json: Dump GraphQL Queries to JSON

Description

Parses GraphQL queries and exports the AST in JSON format.

Usage

graphql2json(input, parse_schema = FALSE)

Arguments

input

a string with graphql syntax

parse_schema

boolean to enable schema definition parsing

Examples

Run this code
graphql2json("{ field(complex: { a: { b: [ $var ] } }) }")
graphql2json("schema { query: QueryType }", TRUE)

Run the code above in your browser using DataLab