agoo 2.14.0 → 2.14.1

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
  SHA256:
3
- metadata.gz: f70842cac2f630e74251967ca0accfcb2dacef7b143bb3707ae74d88a0f1da36
4
- data.tar.gz: 75996d57b98c1d164fa44009f1c6037deb28f22d7179b7bd3ede0296f3d9a605
3
+ metadata.gz: 0fbaa8a1e2f42cda657178256643bcf0161f93d9be09e90512084eb877b12aa9
4
+ data.tar.gz: e33135684316f9e0244f0cc2e781561f99374888c7756866e0d2ed33db1c0446
5
5
  SHA512:
6
- metadata.gz: 39f02fdb5ab101d1414a57a7d712b6b4910b583e2509d0911d2cf5c398badfdb556c6847eaa7e108d280b590792bf3cb007514e4f6cd7c8f57ddb233299e3a0f
7
- data.tar.gz: 10b2f2cc9d56d34e27dd597c5c2d0fa61bcf3921198efcbffcbfece23841656af9dc9eb6909b592e63ff30dd79aed315a55bacf97a471ac5c1c3e7acff4782f2
6
+ metadata.gz: 630cf6226a74119dbb5417a8a33df2893e08e61acd6037f61d6d6a1d424c22a7bb61bfa59c65420b3e4026a421764b128b36ca9ae5dc2087722f338228f2e732
7
+ data.tar.gz: 6798931eaa91d29ccc0e6abe701cc62cc44b129b22e34f0f0dc53e26f409ca27c7a001424197f9c4c2f02820a8a670e38609e408ca4b6e5069957c9981a6b49f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All changes to the Agoo gem are documented here. Releases follow semantic versioning.
4
4
 
5
+ ## [2.14.1] - 2021-06-09
6
+
7
+ ### Fixed
8
+ - Evaluating an empty GraphQL request with comments only no longer crashes.
9
+ - JSON parser bug fixed.
10
+
5
11
  ## [2.14.0] - 2020-11-07
6
12
 
7
13
  ### Added
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # agoo
1
+ # [![{}j](misc/agoo_128.svg)](http://www.ohler.com/agoo) Agoo
2
2
 
3
3
  [![Build Status](https://img.shields.io/travis/ohler55/agoo/master.svg)](http://travis-ci.org/ohler55/agoo?branch=master)
4
4
  [![Gem Version](https://badge.fury.io/rb/agoo.svg)](https://badge.fury.io/rb/agoo)
@@ -164,4 +164,3 @@ the develop branch. Pull requests should be made against the develop branch.
164
164
 
165
165
  - *Perfer* *repo*: https://github.com/ohler55/perfer
166
166
 
167
- Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announcements and news about the Agoo gem.
data/ext/agoo/gqleval.c CHANGED
@@ -620,7 +620,7 @@ eval_post(agooErr err, agooReq req) {
620
620
  } else {
621
621
  result = gql_doc_eval_func(err, doc);
622
622
  }
623
- if (GQL_SUBSCRIPTION == doc->op->kind) {
623
+ if (NULL != doc->op && GQL_SUBSCRIPTION == doc->op->kind) {
624
624
  result = NULL;
625
625
  }
626
626
  DONE:
data/ext/agoo/gqljson.c CHANGED
@@ -307,6 +307,7 @@ parse_object(agooErr err, agooDoc doc) {
307
307
  agoo_doc_skip_jwhite(doc);
308
308
  if ('}' != *doc->cur) {
309
309
  for (; doc->cur < doc->end; doc->cur++) {
310
+ agoo_doc_skip_jwhite(doc);
310
311
  if ('"' != *doc->cur) {
311
312
  return return_parse_err(err, doc, "expected an object key as a string", value);
312
313
  }
data/lib/agoo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Agoo
3
3
  # Agoo version.
4
- VERSION = '2.14.0'
4
+ VERSION = '2.14.1'
5
5
  end
data/test/graphql_test.rb CHANGED
@@ -79,6 +79,7 @@ end
79
79
  $songs_sdl = %^
80
80
  type Query @ruby(class: "Query") {
81
81
  artist(name: String!): Artist
82
+ artists: [Artist!]
82
83
  }
83
84
 
84
85
  type Mutation {
@@ -120,26 +121,30 @@ type Song {
120
121
  ^
121
122
 
122
123
  class Query
123
- attr_reader :artists
124
+ attr_reader :artistHash
124
125
 
125
126
  def initialize(artists)
126
- @artists = artists
127
+ @artistHash = artists
127
128
  end
128
129
 
129
130
  def artist(args)
130
- @artists[args['name']]
131
+ @artistHash[args['name']]
132
+ end
133
+
134
+ def artists(args)
135
+ @artistHash.values
131
136
  end
132
137
  end
133
138
 
134
139
  class Mutation
135
- attr_reader :artists
140
+ attr_reader :artistHash
136
141
 
137
142
  def initialize(artists)
138
- @artists = artists
143
+ @artistHash = artists
139
144
  end
140
145
 
141
146
  def like(args)
142
- artist = @artists[args['artist']]
147
+ artist = @artistHash[args['artist']]
143
148
  artist.like
144
149
  artist
145
150
  end
@@ -187,6 +192,7 @@ type Mutation @ruby(class: "Mutation") {
187
192
 
188
193
  type Query @ruby(class: "Query") {
189
194
  artist(name: String!): Artist
195
+ artists: [Artist!]
190
196
  }
191
197
 
192
198
  type Song @ruby(class: "Song") {
@@ -452,6 +458,30 @@ fragment basic on Artist {
452
458
  post_test(uri, body, 'application/graphql', expect)
453
459
  end
454
460
 
461
+ def test_post_json_fragment
462
+ uri = URI('http://localhost:6472/graphql?indent=2')
463
+ body = %^{
464
+ "query": "fragment basic on Artist {name origin} query list($filter: String) {artists {...basic}}",
465
+ "operationName": "list",
466
+ "variables": {"filters": {}}
467
+ }^
468
+ expect = %^{
469
+ "data":{
470
+ "artists":[
471
+ {
472
+ "name":"Fazerdaze",
473
+ "origin":[
474
+ "Morningside",
475
+ "Auckland",
476
+ "New Zealand"
477
+ ]
478
+ }
479
+ ]
480
+ }
481
+ }^
482
+ post_test(uri, body, 'application/json', expect)
483
+ end
484
+
455
485
  def test_post_inline
456
486
  uri = URI('http://localhost:6472/graphql?indent=2')
457
487
  body = %^
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-07 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -163,7 +163,7 @@ homepage: https://github.com/ohler55/agoo
163
163
  licenses:
164
164
  - MIT
165
165
  metadata: {}
166
- post_install_message:
166
+ post_install_message:
167
167
  rdoc_options:
168
168
  - "-t"
169
169
  - Agoo
@@ -189,17 +189,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements:
191
191
  - Linux or macOS
192
- rubygems_version: 3.1.2
193
- signing_key:
192
+ rubygems_version: 3.2.3
193
+ signing_key:
194
194
  specification_version: 4
195
195
  summary: An HTTP server
196
196
  test_files:
197
- - test/graphql_test.rb
198
- - test/hijack_test.rb
199
- - test/rack_handler_test.rb
200
197
  - test/base_handler_test.rb
201
- - test/log_test.rb
198
+ - test/bind_test.rb
202
199
  - test/domain_test.rb
203
200
  - test/early_hints_test.rb
204
- - test/bind_test.rb
201
+ - test/graphql_test.rb
202
+ - test/hijack_test.rb
203
+ - test/log_test.rb
204
+ - test/rack_handler_test.rb
205
205
  - test/static_test.rb