ecoportal-api-graphql 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -6
- data/lib/ecoportal/api/graphql/logic/base_query.rb +15 -3
- data/lib/ecoportal/api/graphql/logic/query_array.rb +0 -6
- data/lib/ecoportal/api/graphql/query/location_structure.rb +3 -1
- data/lib/ecoportal/api/graphql/query/location_structures.rb +8 -3
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9ee1a2e7ea100fbb03bd2c617e771dafccf7bd443ded39285f230fb68790498
|
4
|
+
data.tar.gz: 9139ed6d2a6adf21990beeb7ffea0ad9dd03a1b80ff924e50249ba904cfa979f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18c0055c77d55072ab9dfadb521e5a740fae4e79e3eed45148c248f887d5ae5ae8f85f2460e788e3529e9274859f76ae3125775a8fbee66de9daf1d4bfe0f242
|
7
|
+
data.tar.gz: 0d8bb739aa1625bf87021160523d42fd885d1537239fbefa4edff0ce0cd2142ebd9488a4411703fba4cdd109bc0be3dc7d0c01f15927f83213e5701c9575e9c6
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.3.9] - 2023-06-xx
|
5
|
-
|
6
|
-
### Added
|
7
|
-
### Changed
|
8
|
-
### Fixed
|
9
4
|
|
10
5
|
### ToDo
|
11
6
|
- Add update operation for `ContractorEntity`
|
@@ -13,7 +8,17 @@ All notable changes to this project will be documented in this file.
|
|
13
8
|
- Analyse how to "DSL" currentOrganization.action.activities
|
14
9
|
- review `path` tracking
|
15
10
|
|
16
|
-
|
11
|
+
|
12
|
+
## [0.3.9] - 2023-06-xx
|
13
|
+
|
14
|
+
### Added
|
15
|
+
- `Ecoportal::API::GraphQL::Logic::BaseQuery`
|
16
|
+
- Added support for **default** values.
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
## [0.3.8] - 2023-07-18
|
17
22
|
|
18
23
|
### Added
|
19
24
|
- Integration for archiving actions.
|
@@ -4,16 +4,27 @@ module Ecoportal
|
|
4
4
|
module Logic
|
5
5
|
class BaseQuery
|
6
6
|
include Ecoportal::API::Common::GraphQL::ClassHelpers
|
7
|
-
inheritable_attrs :accepted_params
|
7
|
+
inheritable_attrs :accepted_params, :param_defaults
|
8
8
|
|
9
9
|
class << self
|
10
|
-
def
|
10
|
+
def param_defaults
|
11
|
+
@param_defaults ||= {}
|
12
|
+
end
|
13
|
+
|
14
|
+
def accepted_params(*keys, default: :unused)
|
11
15
|
@accepted_params ||= []
|
12
16
|
return @accepted_params if keys.empty?
|
17
|
+
keys.map(&:to_sym).uniq.each do |key|
|
18
|
+
@accepted_params |= [key]
|
19
|
+
param_defaults[key] = default unless default == :unused
|
20
|
+
end
|
21
|
+
|
13
22
|
@accepted_params.push(*keys).tap {|ks| ks.uniq!}
|
23
|
+
@accepted_params
|
14
24
|
end
|
15
25
|
|
16
26
|
def clear_accepted_params
|
27
|
+
@param_defaults = {}
|
17
28
|
@accepted_params = []
|
18
29
|
end
|
19
30
|
|
@@ -68,7 +79,8 @@ module Ecoportal
|
|
68
79
|
end
|
69
80
|
|
70
81
|
def graphql_query(path: self.path, **kargs, &block)
|
71
|
-
|
82
|
+
default_params = self.class.param_defaults.dup
|
83
|
+
query_params = self.class.slice_params(default_params.merge(kargs))
|
72
84
|
request(*path) do
|
73
85
|
client.query(query_params, &block)
|
74
86
|
end
|
@@ -4,6 +4,8 @@ module Ecoportal
|
|
4
4
|
module Query
|
5
5
|
class LocationStructure < Ecoportal::API::GraphQL::Logic::Query
|
6
6
|
accepted_params :id
|
7
|
+
accepted_params :includeArchivedNodes, default: true
|
8
|
+
|
7
9
|
field_name :structure
|
8
10
|
|
9
11
|
class_resolver :item_class, Ecoportal::API::GraphQL::Model::LocationStructure
|
@@ -34,7 +36,7 @@ module Ecoportal
|
|
34
36
|
weight
|
35
37
|
updatedAt
|
36
38
|
visitorManagementEnabled
|
37
|
-
nodes(includeArchived:
|
39
|
+
nodes(includeArchived: :includeArchivedNodes) {
|
38
40
|
___Ecoportal__API__GraphQL__Fragment__LocationNode
|
39
41
|
}
|
40
42
|
}
|
@@ -3,7 +3,9 @@ module Ecoportal
|
|
3
3
|
class GraphQL
|
4
4
|
module Query
|
5
5
|
class LocationStructures < Ecoportal::API::GraphQL::Logic::QueryArray
|
6
|
-
accepted_params :includeArchived, :includeUnpublished
|
6
|
+
accepted_params :includeArchived, :includeUnpublished, default: false
|
7
|
+
accepted_params :includeArchivedNodes, default: true
|
8
|
+
|
7
9
|
field_name :structures
|
8
10
|
|
9
11
|
class_resolver :item_class, Ecoportal::API::GraphQL::Model::LocationStructure
|
@@ -13,7 +15,10 @@ module Ecoportal
|
|
13
15
|
def basic_block(&block)
|
14
16
|
final_block = block || default_query_block
|
15
17
|
Proc.new {
|
16
|
-
query(includeArchived: :boolean,
|
18
|
+
query(includeArchived: :boolean,
|
19
|
+
includeUnpublished: :boolean,
|
20
|
+
includeArchivedNodes: :boolean
|
21
|
+
) {
|
17
22
|
currentOrganization {
|
18
23
|
locations {
|
19
24
|
structures(
|
@@ -37,7 +42,7 @@ module Ecoportal
|
|
37
42
|
archived
|
38
43
|
weight
|
39
44
|
visitorManagementEnabled
|
40
|
-
nodes(includeArchived:
|
45
|
+
nodes(includeArchived: :includeArchivedNodes) {
|
41
46
|
___Ecoportal__API__GraphQL__Fragment__LocationNode
|
42
47
|
}
|
43
48
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecoportal-api-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|