Repository is archived
No commit activity in last 3 years
No release in over 3 years
A parser for the GraphQL IDL format.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

GraphQL-IDL-Parser

This gem will accept a GraphQL IDL file and parse it. It uses gjtorikian/graphql-idl-parser as the mechanism for this, which is written in Rust, making this blazing fast.

Build Status

Installation

Add this line to your application's Gemfile:

gem 'graphql-idl-parser'

And then execute:

$ bundle

Or install it yourself as:

$ gem install graphql-idl-parser

Usage

# feed it a file
parser = GraphQL::IDLParser.new(filename: filename)

# or feed it a string
parser = GraphQL::IDLParser.new(schema: contents)

# execute!
results = parser.process

Benchmarks

Check it out with bundle exec rake benchmark:

Warming up --------------------------------------
           pure ruby     1.000  i/100ms
           this gem      7.000  i/100ms
Calculating -------------------------------------
           pure ruby      6.527  (± 0.0%) i/s -     33.000  in   5.082540s
           this gem      73.511  (± 5.4%) i/s -    371.000  in   5.064868s

Comparison:
           this gem :       73.5 i/s
           pure ruby:        6.5 i/s - 11.26x  slower