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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5f809dc67b6cd33f071581cc7cb1afbf8f30ef4
4
- data.tar.gz: d277a96dfbc145f057d82a6f7e87415d3f4c9b12
3
+ metadata.gz: 991f9f625b2275609b07eab64c3002d1579f511e
4
+ data.tar.gz: 0f282d13ab730c8a061ae5f14a748e2c9232a7fc
5
5
  SHA512:
6
- metadata.gz: e57017016982b4268d335afea057394ee3373429f7c9d2ad601c67899c661ad3dc90d7d66b0eaccf575121c206b2570dda6dc2dac25159dc1c2e1560eb43205c
7
- data.tar.gz: 3ad7dd6c81802dc3b711f456282ed72a9ea1cb4f65bd2fddaeb61bf6514eca075d35566d333da6876926363a30d1e35a8b9a9cacc36466691125a8a44edf6fb5
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.5.0.tar.gz
21
- - tar -xzvf v0.5.0.tar.gz
22
- - cd libgraphqlparser-0.5.0/ && sudo cmake . && sudo make && sudo make install
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
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ # 1.1.0
4
+
5
+ - Support `null`
6
+
7
+ # 1.0.0
8
+
9
+ - No changes
3
10
 
4
11
  # 0.5.2
5
12
 
@@ -64,4 +64,5 @@ void Init_graphql_libgraphqlparser_ext() {
64
64
  ATTACH_CALLBACKS(list_value);
65
65
  ATTACH_CALLBACKS(object_value);
66
66
  ATTACH_CALLBACKS(object_field);
67
+ ATTACH_CALLBACKS(null_value);
67
68
  }
@@ -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);
@@ -27,5 +27,6 @@ VISITOR_CALLBACKS(enum_value, EnumValue);
27
27
  VISITOR_CALLBACKS(list_value, ListValue);
28
28
  VISITOR_CALLBACKS(object_value, ObjectValue);
29
29
  VISITOR_CALLBACKS(object_field, ObjectField);
30
+ VISITOR_CALLBACKS(null_value, NullValue);
30
31
 
31
32
  #endif
@@ -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.0'
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"
@@ -44,6 +44,8 @@ module GraphQL
44
44
  when Nodes::ListLiteral
45
45
  # mutability! 🎉
46
46
  current.value = node.values
47
+ when Nodes::NullValue
48
+ current.value = node
47
49
  when Nodes::InputObject
48
50
  current.value = node
49
51
  when Nodes::Enum
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Libgraphqlparser
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -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 3, query.selections.length
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.0.0
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: 2016-10-25 00:00:00.000000000 Z
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.0'
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.0'
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.0
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