graphql-libgraphqlparser 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/CHANGELOG.md +7 -0
- data/ext/graphql_libgraphqlparser_ext/graphql_libgraphqlparser_ext.c +1 -0
- data/ext/graphql_libgraphqlparser_ext/visitor_functions.c +10 -0
- data/ext/graphql_libgraphqlparser_ext/visitor_functions.h +1 -0
- data/graphql-libgraphqlparser.gemspec +1 -1
- data/lib/graphql/libgraphqlparser/builder.rb +2 -0
- data/lib/graphql/libgraphqlparser/version.rb +1 -1
- data/test/graphql/libgraphqlparser_test.rb +8 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 991f9f625b2275609b07eab64c3002d1579f511e
|
4
|
+
data.tar.gz: 0f282d13ab730c8a061ae5f14a748e2c9232a7fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d40cf6b525e4afc651f97f868c120241c8cb507b194192e9a80c55e387a18416c81f79933ce290906d4ee4f86839fbf64e36131e9f5a74fcfae9486b9fb423bc
|
7
|
+
data.tar.gz: ae7882681347d4da3d8c82fc4c7947226ddfc0d23b995e858cbfe6e10030d46964771a3782db4600514c34399b5fcca2c8cab42553f3463cf5e26f8e4cbdb44d
|
data/.travis.yml
CHANGED
@@ -17,9 +17,9 @@ before_install:
|
|
17
17
|
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-5 /usr/bin/g++
|
18
18
|
- g++ --version
|
19
19
|
- sudo apt-get install bison
|
20
|
-
- wget https://github.com/graphql/libgraphqlparser/archive/v0.
|
21
|
-
- tar -xzvf v0.
|
22
|
-
- cd libgraphqlparser-0.
|
20
|
+
- wget https://github.com/graphql/libgraphqlparser/archive/v0.6.0.tar.gz
|
21
|
+
- tar -xzvf v0.6.0.tar.gz
|
22
|
+
- cd libgraphqlparser-0.6.0/ && sudo cmake . && sudo make && sudo make install
|
23
23
|
- gem update --system
|
24
24
|
- gem install bundler
|
25
25
|
script:
|
data/CHANGELOG.md
CHANGED
@@ -227,6 +227,16 @@ void named_type_end_visit(const struct GraphQLAstNamedType* node, void* builder_
|
|
227
227
|
end_visit(builder_ptr);
|
228
228
|
}
|
229
229
|
|
230
|
+
int null_value_begin_visit(const struct GraphQLAstNullValue* node, void* builder_ptr) {
|
231
|
+
VALUE rb_node = build_rb_node((struct GraphQLAstNode*) node, "NullValue", builder_ptr);
|
232
|
+
VALUE rb_string = rb_str_new2("null");
|
233
|
+
rb_funcall(rb_node, name_set_intern, 1, rb_string);
|
234
|
+
return 1;
|
235
|
+
}
|
236
|
+
|
237
|
+
void null_value_end_visit(const struct GraphQLAstListType* node, void* builder_ptr) {
|
238
|
+
end_visit(builder_ptr);
|
239
|
+
}
|
230
240
|
|
231
241
|
int float_value_begin_visit(const struct GraphQLAstFloatValue* node, void* builder_ptr) {
|
232
242
|
const char* str_float = GraphQLAstFloatValue_get_value(node);
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_runtime_dependency 'graphql', '~> 1.
|
20
|
+
spec.add_runtime_dependency 'graphql', '~> 1.2'
|
21
21
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.0'
|
23
23
|
spec.add_development_dependency "guard", "~> 2.12"
|
@@ -15,7 +15,7 @@ describe GraphQL::Libgraphqlparser do
|
|
15
15
|
field
|
16
16
|
anotherField
|
17
17
|
}
|
18
|
-
|
18
|
+
aField(anArg: null) { a }
|
19
19
|
}
|
20
20
|
|
21
21
|
fragment moreNestedFields on NestedType @or(something: "ok") {
|
@@ -42,7 +42,7 @@ describe GraphQL::Libgraphqlparser do
|
|
42
42
|
assert_equal "getStuff", query.name
|
43
43
|
assert_equal "query", query.operation_type
|
44
44
|
assert_equal 2, query.variables.length
|
45
|
-
assert_equal
|
45
|
+
assert_equal 4, query.selections.length
|
46
46
|
assert_equal 1, query.directives.length
|
47
47
|
assert_equal [2, 5], [query.line, query.col]
|
48
48
|
end
|
@@ -95,6 +95,12 @@ describe GraphQL::Libgraphqlparser do
|
|
95
95
|
describe "arguments" do
|
96
96
|
let(:literal_argument) { query.selections.first.arguments.last }
|
97
97
|
let(:variable_argument) { query.selections.first.arguments.first }
|
98
|
+
let(:null_argument) { query.selections.last.arguments.first }
|
99
|
+
|
100
|
+
it "handles null values for arguments" do
|
101
|
+
assert null_argument.value.is_a?(GraphQL::Language::Nodes::NullValue)
|
102
|
+
assert_equal "null", null_argument.value.name
|
103
|
+
end
|
98
104
|
|
99
105
|
it "gets name and literal value" do
|
100
106
|
assert_equal "ok", literal_argument.name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-libgraphqlparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
213
|
version: '0'
|
214
214
|
requirements: []
|
215
215
|
rubyforge_project:
|
216
|
-
rubygems_version: 2.2
|
216
|
+
rubygems_version: 2.5.2
|
217
217
|
signing_key:
|
218
218
|
specification_version: 4
|
219
219
|
summary: Use Libgraphqlparser to parse queries for the GraphQL gem
|