Comments (7)
Does the attached commit work for you? Seems legit from the tests I added, but I would like to have other eyes on it before I merge it to master.
from libgraphqlparser.
The graphql-parser gem seems to have an issue with this branch. I'm not a C++ person, any idea what's going on here:
Installing graphql-parser 0.0.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/robgilson/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20160429-11555-1e20m4.rb extconf.rb
checking for main() in -lgraphqlparser... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling graphql_parser.c
compiling graphql_ruby.c
graphql_ruby.c:514:18: warning: implicit declaration of function 'GraphQLAstArrayValue_get_values_size' is invalid in C99 [-Wimplicit-function-declaration]
return INT2FIX(GraphQLAstArrayValue_get_values_size(node));
^
/Users/robgilson/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:234:30: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) (((VALUE)(i))<<1 | FIXNUM_FLAG)
^
graphql_ruby.c:889:7: error: no member named 'visit_array_value' in 'struct GraphQLAstVisitorCallbacks'; did you mean 'visit_float_value'?
cbs.visit_array_value = visit_array_value;
^~~~~~~~~~~~~~~~~
visit_float_value
/usr/local/include/graphqlparser/c/GraphQLAstVisitor.h:38:26: note: 'visit_float_value' declared here
FOR_EACH_CONCRETE_TYPE(FUNC_MEMBER)
^
/usr/local/include/graphqlparser/c/GraphQLAstForEachConcreteType.h:21:28: note: expanded from macro 'FOR_EACH_CONCRETE_TYPE'
MACRO(IntValue, int_value) \
^
/usr/local/include/graphqlparser/c/GraphQLAstVisitor.h:26:29: note: expanded from macro 'FUNC_MEMBER'
visit_##snake_type##_func visit_##snake_type; \
^
<scratch space>:68:1: note: expanded from here
visit_float_value
^
graphql_ruby.c:889:25: warning: incompatible pointer types assigning to 'visit_float_value_func' (aka 'int (*)(const struct GraphQLAstFloatValue *, void *)') from 'int (const struct GraphQLAstArrayValue *, void *)' [-Wincompatible-pointer-types]
cbs.visit_array_value = visit_array_value;
^ ~~~~~~~~~~~~~~~~~
graphql_ruby.c:890:7: error: no member named 'end_visit_array_value' in 'struct GraphQLAstVisitorCallbacks'; did you mean 'end_visit_float_value'?
cbs.end_visit_array_value = end_visit_array_value;
^~~~~~~~~~~~~~~~~~~~~
end_visit_float_value
/usr/local/include/graphqlparser/c/GraphQLAstVisitor.h:38:26: note: 'end_visit_float_value' declared here
FOR_EACH_CONCRETE_TYPE(FUNC_MEMBER)
^
/usr/local/include/graphqlparser/c/GraphQLAstForEachConcreteType.h:21:28: note: expanded from macro 'FOR_EACH_CONCRETE_TYPE'
MACRO(IntValue, int_value) \
^
/usr/local/include/graphqlparser/c/GraphQLAstVisitor.h:27:33: note: expanded from macro 'FUNC_MEMBER'
end_visit_##snake_type##_func end_visit_##snake_type;
^
<scratch space>:71:1: note: expanded from here
end_visit_float_value
^
graphql_ruby.c:890:29: warning: incompatible pointer types assigning to 'end_visit_float_value_func' (aka 'void (*)(const struct GraphQLAstFloatValue *, void *)') from 'void (const struct GraphQLAstArrayValue *, void *)' [-Wincompatible-pointer-types]
cbs.end_visit_array_value = end_visit_array_value;
^ ~~~~~~~~~~~~~~~~~~~~~
3 warnings and 2 errors generated.
make: *** [graphql_ruby.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/robgilson/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/graphql-parser-0.0.2 for inspection.
Results logged to /Users/robgilson/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/graphql-parser-0.0.2/gem_make.out
from libgraphqlparser.
Looks like the graphql-parser gem hasn't been updated to be compatible with this API-breaking change on master (which corrects an API difference from graphql-js): 5b83654
That's probably because I haven't cut a versioned release since making that change. I'll fix that, though I'd prefer to include subscription support rather than do a point release just for that.
To fix it in graphql-parser, you probably just need to change array_value to list_value.
from libgraphqlparser.
I also had to change GraphQLAstArrayValue to GraphQLAstListValue locally. Here are the find/replace commands I used, in the graphql-parser directory:
perl -p -i -e 's|array_value|list_value|g' $(git grep -l array_value)
perl -p -i -e 's|ArrayValue|ListValue|g' $(git grep -l ArrayValue)
Hope this helps!
from libgraphqlparser.
I've set up a fork of graphql-parser with your changes and added test for subscriptions but it isn't passing yet. Not sure why:
https://github.com/D1plo1d/graphql-parser/tree/feature/subscriptions
You can run the tests with: bundle install & rake compile & rake test
from libgraphqlparser.
Nm, typos strike again! Totally works :)
from libgraphqlparser.
w00t! Thanks @swolchok!
from libgraphqlparser.
Related Issues (20)
- Why not use PEGTL instead?
- New version? HOT 8
- SONAME versioning
- Parsing query with variables HOT 1
- Compilation failed for libgraphqlparser (graphqlparser & lexer.cpp) HOT 2
- Update master to main
- Improve Readme?
- Create release to include bugfixes resolved on master HOT 1
- graphqlparser_bison: parser.ypp:8.10-12: error: invalid version requirement: 3 HOT 2
- Getting undefined reference error when trying to compile dump_json_ast.cpp
- Found PythonInterp: /usr/bin/python (found suitable version "3.10.12", minimum required is "2")
- Missing support for types implementing multiple interfaces HOT 1
- Locations not properly updated when parsing multi-line block strings
- CONTRIBUTING.md still mentions license to be BSD HOT 1
- Checked in Flex / Bison files are under GPL license HOT 3
- Build fails with latest ctypesgen HOT 1
- Missing support for extending schemas
- Remove "facebook" namespace from cpp? HOT 1
- Missing support for extending interfaces
- Missing support for extending input object types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libgraphqlparser.