• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

rmosolgo/graphql-libgraphqlparser-ruby: libgraphqlparser + graphql gem

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

rmosolgo/graphql-libgraphqlparser-ruby

开源软件地址(OpenSource Url):

https://github.com/rmosolgo/graphql-libgraphqlparser-ruby

开源编程语言(OpenSource Language):

Ruby 52.6%

开源软件介绍(OpenSource 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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap