graphql-libgraphqlparser 0.2.3 → 0.3.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: 7997ac3d88dd7977b5f13422fcb8713573b120a3
4
- data.tar.gz: 8aee3748c2a4dff3423c2ea8227b44813f220af0
3
+ metadata.gz: 7c4613bbf60c0b4f7d3c46b9eab1cfebd09e8bca
4
+ data.tar.gz: 5fd0643c098f384ed2c179d0c4457e5fb74baf5a
5
5
  SHA512:
6
- metadata.gz: a5d318b7feb23ec51e71f691e93d0b4b1d46ca9c4eb83dbc3e7f886399eb424783a1d9b457b53d1e32eef4c6ae26ea92f544cb829baf8fb0ac3d93d601c5d7ae
7
- data.tar.gz: 10f0bff2509e0092b5a8976d535876d6c48dc6b51661927b8f989f87427187701ec8d151cf9f0574e7bc4a91efcbb12753e80212ef791b987ab6a044871211e2
6
+ metadata.gz: ae591657133ee1c6a3c198478621d374af2213fd603e9b63a35af1d834a686e92ed111590d23792737cd36c0a36e49bec4cf8d0eb3971346bee2a352ad275cce
7
+ data.tar.gz: fb5d52c13abf84e35f0a479c50633d8b59e5e0a9f498c8784f746682f5f8ad3baae020357dad491f050b07f262939f1363689e392f3341caa7bf267895018dd2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ # 0.3.0
4
+
5
+ - Fix inline fragments without type conditions
6
+
7
+ # 0.2.3
8
+
9
+ - Fix graphql version lock
10
+
11
+ # 0.2.2
12
+
13
+ - Use a stack variable for the AST node instead of putting it on the heap
14
+
15
+ # 0.2.1
16
+
17
+ - Use Ruby's `StringValueCStr` to ensure that the string is null-terminated
3
18
 
4
19
  # 0.2.0
5
20
 
@@ -39,7 +39,7 @@
39
39
  ) \
40
40
  ); \
41
41
 
42
- #define ASSIGN_NAMED_TYPE(get_type_fn) \
42
+ #define ASSIGN_NAMED_TYPE(type) \
43
43
  rb_funcall( \
44
44
  rb_node, \
45
45
  type_set_intern, \
@@ -47,7 +47,7 @@
47
47
  rb_str_new2( \
48
48
  GraphQLAstName_get_value( \
49
49
  GraphQLAstNamedType_get_name( \
50
- get_type_fn(node) \
50
+ type \
51
51
  ) \
52
52
  ) \
53
53
  ) \
@@ -127,7 +127,8 @@ void variable_definition_end_visit(const struct GraphQLAstVariableDefinition* no
127
127
  int fragment_definition_begin_visit(const struct GraphQLAstFragmentDefinition* node, void* builder_ptr) {
128
128
  BEGIN("FragmentDefinition")
129
129
  ASSIGN_NAME(GraphQLAstFragmentDefinition_get_name)
130
- ASSIGN_NAMED_TYPE(GraphQLAstFragmentDefinition_get_type_condition)
130
+ const struct GraphQLAstNamedType *type = GraphQLAstFragmentDefinition_get_type_condition(node);
131
+ ASSIGN_NAMED_TYPE(type)
131
132
  return 1;
132
133
  }
133
134
 
@@ -197,7 +198,11 @@ void fragment_spread_end_visit(const struct GraphQLAstFragmentSpread* node, void
197
198
 
198
199
  int inline_fragment_begin_visit(const struct GraphQLAstInlineFragment* node, void* builder_ptr) {
199
200
  BEGIN("InlineFragment")
200
- ASSIGN_NAMED_TYPE(GraphQLAstInlineFragment_get_type_condition)
201
+ const struct GraphQLAstNamedType *type = GraphQLAstInlineFragment_get_type_condition(node);
202
+ if (type) {
203
+ ASSIGN_NAMED_TYPE(type)
204
+ }
205
+
201
206
  return 1;
202
207
  }
203
208
 
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "guard-rake", "~> 1.0"
27
27
  spec.add_development_dependency 'minitest', '~> 5.8'
28
28
  spec.add_development_dependency "minitest-reporters", "~>1.0"
29
- spec.add_development_dependency 'rake', '~> 10.0'
29
+ spec.add_development_dependency 'rake', '~> 11.0'
30
30
  spec.add_development_dependency 'rake-compiler', '~> 0.9'
31
31
  end
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Libgraphqlparser
3
- VERSION = '0.2.3'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -148,6 +148,15 @@ describe GraphQL::Libgraphqlparser do
148
148
  it "gets position info" do
149
149
  assert_equal [10, 7], inline_fragment.position
150
150
  end
151
+
152
+ describe "without type condition" do
153
+ let(:query_string) { 'query { ... @skip(if: false) { field } }' }
154
+ let(:inline_fragment) { query.selections[0] }
155
+ it "gets directives and nil type" do
156
+ assert_equal nil, inline_fragment.type
157
+ assert_equal 1, inline_fragment.directives.length
158
+ end
159
+ end
151
160
  end
152
161
 
153
162
  describe "inputs" do
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: 0.2.3
4
+ version: 0.3.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-03-21 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '10.0'
131
+ version: '11.0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '10.0'
138
+ version: '11.0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rake-compiler
141
141
  requirement: !ruby/object:Gem::Requirement