Coder Social home page Coder Social logo

graphql-libgraphqlparser-ruby's Introduction

graphql-libgraphqlparser Build Status Gem Version

Make graphql faster with libgraphqlparser. Ruby bindings to a C-level GraphQL parser.

It's faster:

~/projects/graphql-libgraphqlparser $ bundle exec ruby benchmark.rb
              user     system      total        real
Ruby      0.090000   0.000000   0.090000 (  0.088713)
C         0.010000   0.000000   0.010000 (  0.012827)
~/projects/graphql-libgraphqlparser $ bundle exec ruby benchmark.rb
              user     system      total        real
Ruby      0.090000   0.010000   0.100000 (  0.090548)
C         0.010000   0.000000   0.010000 (  0.013126)
~/projects/graphql-libgraphqlparser $ bundle exec ruby benchmark.rb
              user     system      total        real
Ruby      0.080000   0.000000   0.080000 (  0.090066)
C         0.020000   0.000000   0.020000 (  0.011790)
~/projects/graphql-libgraphqlparser $ bundle show graphql
~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/graphql-0.19.4

Installation

This gem depends on libgraphqlparser (>= 0.5.0). You can install it a few ways:

  • Homebrew: brew install libgraphqlparser

  • From Source:

    wget https://github.com/graphql/libgraphqlparser/archive/v0.5.0.tar.gz
    tar -xzvf v0.5.0.tar.gz
    cd libgraphqlparser-0.5.0/ && cmake . && make && make install
    
  • With heroku-buildpack-libgraphqlparser

Then, install this gem:

gem "graphql-libgraphqlparser"

When you require this gem, it overrides GraphQL.parse:

require "graphql/libgraphqlparser"

Overriding the location of libgraphqlparser

This gem will search for libgraphqlparser at /usr and /usr/local. If you follow the official install instructions, you don't need to do anything else. If however you have installed libgraphqlparser at a different location, you will need to specify it during gem install. Note that the headers needed to compile the extension are not located at the standard include subdirectory but rather include/graphqlparser.

Example override:

export LIBGRAPHQLPARSER_PATH=/my-custom-path
gem install graphql-libgraphqlparser -- \
  --with-graphqlparser-lib=$LIBGRAPHQLPARSER_PATH/lib \
  --with-graphqlparser-include=$LIBGRAPHQLPARSER_PATH/include/graphqlparser

Libgraphqlparser versions

The Ruby gem expects certain versions of libgraphqlparser to be installed. I couldn't figure out how to check this in extconf.rb, so I documented it here:

libgraphqlparser version graphql-libgraphqlparser(Ruby gem) version

= 0.5.0 | 0.5.0 <= 0.4.0 | 0.4.0

graphql-libgraphqlparser-ruby's People

Contributors

chanks avatar dylanahsmith avatar ianks avatar raphaelcosta avatar rmosolgo avatar staugaard avatar xuorig avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.