search_object_graphql 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -3
- data/lib/search_object/plugin/graphql/version.rb +1 -1
- data/lib/search_object/plugin/graphql.rb +1 -0
- data/spec/search_object/plugin/graphql_spec.rb +59 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41da46a65689f3f9178a8e4848df69af6e03c97e8afb30560d33bafda1562b2b
|
4
|
+
data.tar.gz: 986e0d43576c42487751cfbc391caca2ec1cf694f6f16c9cb668d6d778570546
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f81ce9688f696bc17e0b4fbefdc7b8d2caa8defbebe637d5a45f980cc5ac40c9d065310414d1e96134fe0cc4a08b67a4b7cecfff04d01be293e93e8dccf5b43f
|
7
|
+
data.tar.gz: f0554a519c7248862329c7ce4a39667e167718e3daa5be221c8cbbac4293b35fc18c27a68f7adbb8b2994170207694130e9da8f41f0690680fab54bb9ac3c9e0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6
|
1
|
+
2.7.6
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## Version 1.0.
|
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.
|
11
|
+
## Version 1.0.2
|
8
12
|
|
9
|
-
* __[feature]__ Added `argument_options` to `
|
13
|
+
* __[feature]__ Added `argument_options` to `option` (@wuz)
|
10
14
|
|
11
15
|
## Version 1.0.1
|
12
16
|
|
@@ -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.
|
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-
|
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.
|
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:
|