search_object_graphql 1.0.3 → 1.0.4

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: 4743546d8933b7412977b5b2736eca71fd8950ef016ca5e4f766a73e7f75d0dd
4
- data.tar.gz: a9772b5cb3cfda0e8cbc334a68d24d919b964e81af00be8696a91b3bc0d60947
3
+ metadata.gz: 41da46a65689f3f9178a8e4848df69af6e03c97e8afb30560d33bafda1562b2b
4
+ data.tar.gz: 986e0d43576c42487751cfbc391caca2ec1cf694f6f16c9cb668d6d778570546
5
5
  SHA512:
6
- metadata.gz: 5c1400ac1875e40b26a1ef4c8e5180e2324cc5e671b715e61172f5dd51cce443fce19dfaa92d5783791a3d8cc06de9c6d1a238b2f9e9c3158aab35cee21c58d6
7
- data.tar.gz: ff5bd7c05cc45cd815a8682423dee031ea720d7c3da766a8aa19e9df1d52d9013592ed4bf58255c218ab9dc0e8c1c0c2a6fd95c91e7961f04f346fe0f3a2bf1f
6
+ metadata.gz: f81ce9688f696bc17e0b4fbefdc7b8d2caa8defbebe637d5a45f980cc5ac40c9d065310414d1e96134fe0cc4a08b67a4b7cecfff04d01be293e93e8dccf5b43f
7
+ data.tar.gz: f0554a519c7248862329c7ce4a39667e167718e3daa5be221c8cbbac4293b35fc18c27a68f7adbb8b2994170207694130e9da8f41f0690680fab54bb9ac3c9e0
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.2
1
+ 2.7.6
data/CHANGELOG.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # Changelog
2
2
 
3
- ## Version 1.0.2
3
+ ## Version 1.0.4
4
+
5
+ * __[feature]__ Added `deprecation_reason` to `option` (@IgrekYY)
6
+
7
+ ## Version 1.0.3
4
8
 
5
9
  * __[fix]__ Support GraphQL 2.0 gem (@rstankov)
6
10
 
7
- ## Version 1.0.1
11
+ ## Version 1.0.2
8
12
 
9
- * __[feature]__ Added `argument_options` to `options` (@wuz)
13
+ * __[feature]__ Added `argument_options` to `option` (@wuz)
10
14
 
11
15
  ## Version 1.0.1
12
16
 
@@ -3,7 +3,7 @@
3
3
  module SearchObject
4
4
  module Plugin
5
5
  module Graphql
6
- VERSION = '1.0.3'
6
+ VERSION = '1.0.4'
7
7
  end
8
8
  end
9
9
  end
@@ -37,6 +37,7 @@ module SearchObject
37
37
  argument_options[:camelize] = options[:camelize] if options.include?(:camelize)
38
38
  argument_options[:default_value] = options[:default] if options.include?(:default)
39
39
  argument_options[:description] = options[:description] if options.include?(:description)
40
+ argument_options[:deprecation_reason] = options[:deprecation_reason] if options.include?(:deprecation_reason)
40
41
 
41
42
  argument(name.to_s, type, **argument_options)
42
43
 
@@ -410,6 +410,65 @@ describe SearchObject::Plugin::Graphql do
410
410
  )
411
411
  end
412
412
 
413
+ it 'accepts deprecation_reason' do
414
+ schema = define_search_class_and_return_schema do
415
+ type PostType, null: true
416
+
417
+ option('option', type: String, deprecation_reason: 'Not in use anymore')
418
+ end
419
+
420
+
421
+ result = schema.execute <<-SQL
422
+ {
423
+ __type(name: "Query") {
424
+ name
425
+ fields {
426
+ args(includeDeprecated: false) {
427
+ name
428
+ }
429
+ }
430
+ }
431
+ }
432
+ SQL
433
+
434
+ expect(result.to_h).to eq(
435
+ 'data' => {
436
+ '__type' => {
437
+ 'name' => 'Query',
438
+ 'fields' => [{
439
+ 'args' => []
440
+ }]
441
+ }
442
+ }
443
+ )
444
+
445
+ result = schema.execute <<-SQL
446
+ {
447
+ __type(name: "Query") {
448
+ name
449
+ fields {
450
+ args(includeDeprecated: true) {
451
+ name
452
+ }
453
+ }
454
+ }
455
+ }
456
+ SQL
457
+
458
+ expect(result.to_h).to eq(
459
+ 'data' => {
460
+ '__type' => {
461
+ 'name' => 'Query',
462
+ 'fields' => [{
463
+ 'args' => [{
464
+ 'name' => 'option',
465
+ }]
466
+ }]
467
+ }
468
+ }
469
+ )
470
+ end
471
+
413
472
  it 'raises error when no type is given' do
414
473
  expect { define_search_class { option :name } }.to raise_error described_class::MissingTypeDefinitionError
415
474
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_object_graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Radoslav Stankov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-18 00:00:00.000000000 Z
11
+ date: 2022-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -192,7 +192,7 @@ homepage: https://github.com/RStankov/SearchObjectGraphQL
192
192
  licenses:
193
193
  - MIT
194
194
  metadata: {}
195
- post_install_message:
195
+ post_install_message:
196
196
  rdoc_options: []
197
197
  require_paths:
198
198
  - lib
@@ -207,8 +207,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.0.3
211
- signing_key:
210
+ rubygems_version: 3.1.6
211
+ signing_key:
212
212
  specification_version: 4
213
213
  summary: Maps search objects to GraphQL resolvers
214
214
  test_files: