ecoportal-api-graphql 0.1.2 → 0.1.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/CHANGELOG.md +13 -1
- data/lib/ecoportal/api/common/graphql/client.rb +3 -3
- data/lib/ecoportal/api/graphql/base/query_connection.rb +12 -3
- data/lib/ecoportal/api/graphql/query/actions.rb +7 -6
- data/lib/ecoportal/api/graphql/query/contractor_entities.rb +2 -4
- 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: 5ebcd32d52a269e3f9b9348fdb9e3ca80b3c07a75872e67759d978cd57c233d2
|
4
|
+
data.tar.gz: 80bbb9bbaa4a8a420b028cb3f5d4f1685621e176a239710024cede3ab12eed87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdbb369046537a6916711f0bbae1cb7a4edd443c6ce19e97bcc529eb6eab72805dd16714aa5a6d165da6690d46d9a0e28e406d036551a6c51b787fd3f44addfb
|
7
|
+
data.tar.gz: 0a3f51c9733e66af42edaf63b2c93546cb8ec929fbecfa0dc70a555d9fd846f0228322d2bd85695044e0ac3b875266ae9e3a622f5226d759ebcf1345f287979f
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.1.
|
4
|
+
## [0.1.5] - 2022-09-xx
|
5
5
|
|
6
6
|
### Added
|
7
7
|
|
@@ -16,6 +16,18 @@ All notable changes to this project will be documented in this file.
|
|
16
16
|
- Analyse how to "DSL" currentOrganization.action.activities
|
17
17
|
- review `path` tracking
|
18
18
|
|
19
|
+
## [0.1.4] - 2022-09-16
|
20
|
+
|
21
|
+
### Fixed
|
22
|
+
- Able to inject connection block to `each`
|
23
|
+
- Error handling delegated to parent class (`QueryConnection`)
|
24
|
+
- Retrieve `id` on elements of `Array`
|
25
|
+
|
26
|
+
## [0.1.3] - 2022-09-15
|
27
|
+
|
28
|
+
### Fixed
|
29
|
+
- Fixed circular reference to `org_id` in `Ecoportal::API::Common::GraphQL::Client`
|
30
|
+
|
19
31
|
## [0.1.2] - 2022-09-15
|
20
32
|
|
21
33
|
### Changed
|
@@ -8,7 +8,7 @@ module Ecoportal
|
|
8
8
|
|
9
9
|
include Ecoportal::API::Common::GraphQL::AuthService
|
10
10
|
|
11
|
-
def initialize(email: nil, pass: nil, org_id: org_id,
|
11
|
+
def initialize(email: nil, pass: nil, org_id: self.org_id,
|
12
12
|
host: server, schema_path: host, no_schema: false)
|
13
13
|
@org_id = org_id
|
14
14
|
@host = host
|
@@ -34,12 +34,12 @@ module Ecoportal
|
|
34
34
|
self.class.new(org_id: org_id, host: host, schema_path: schema_path, no_schema: no_schema)
|
35
35
|
end
|
36
36
|
|
37
|
-
private
|
38
|
-
|
39
37
|
def org_id
|
40
38
|
@org_id || fetch_env_required("ORGANIZATION_ID")
|
41
39
|
end
|
42
40
|
|
41
|
+
private
|
42
|
+
|
43
43
|
def url
|
44
44
|
"#{Ecoportal::API::Common::GraphQL::HttpClient.base_url(host)}/api/#{org_id}/graphql"
|
45
45
|
end
|
@@ -20,12 +20,21 @@ module Ecoportal
|
|
20
20
|
raise "Missuse. You have to implement this method in the child class"
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
|
23
|
+
def graphql_query(**kargs, &block)
|
24
|
+
query_params = self.class.slice_params(kargs)
|
25
|
+
client.query(query_params, &block)
|
26
|
+
rescue Faraday::ParsingError => e
|
27
|
+
puts "Internal Error with these params:"
|
28
|
+
pp kargs
|
29
|
+
raise
|
30
|
+
end
|
31
|
+
|
32
|
+
def each(connection_block: nil, **kargs, &block)
|
33
|
+
return to_enum(:each, **kargs, connection_block: connection_block) unless block
|
25
34
|
cursor = nil; results = 0
|
26
35
|
loop do
|
27
36
|
kargs.update(after: cursor) if cursor
|
28
|
-
connection = query(**kargs)
|
37
|
+
connection = query(**kargs, &connection_block)
|
29
38
|
#total = connection.totalCount
|
30
39
|
pageInfo = connection.pageInfo
|
31
40
|
connection.nodes.each do |item|
|
@@ -8,10 +8,8 @@ module Ecoportal
|
|
8
8
|
|
9
9
|
def query(path: default_base_path, **kargs, &block)
|
10
10
|
path ||= default_base_path
|
11
|
-
kargs = self.class.slice_params(kargs)
|
12
11
|
request(*path, "actions") do
|
13
|
-
|
14
|
-
client.query(kargs, &basic_block)
|
12
|
+
graphql_query(**kargs, &basic_block(&block))
|
15
13
|
end
|
16
14
|
end
|
17
15
|
|
@@ -60,9 +58,14 @@ module Ecoportal
|
|
60
58
|
name
|
61
59
|
description
|
62
60
|
assignedTo {
|
61
|
+
id
|
63
62
|
name
|
64
63
|
email
|
65
64
|
}
|
65
|
+
createdAt {
|
66
|
+
dateTime
|
67
|
+
timeZone
|
68
|
+
}
|
66
69
|
dueDate {
|
67
70
|
dateTime
|
68
71
|
timeZone
|
@@ -76,13 +79,11 @@ module Ecoportal
|
|
76
79
|
email
|
77
80
|
}
|
78
81
|
linkedResources {
|
82
|
+
id
|
79
83
|
page {
|
80
84
|
name
|
81
85
|
mouldCounter
|
82
86
|
}
|
83
|
-
field {
|
84
|
-
label
|
85
|
-
}
|
86
87
|
}
|
87
88
|
}
|
88
89
|
}
|
@@ -8,11 +8,9 @@ module Ecoportal
|
|
8
8
|
|
9
9
|
def query(path: default_base_path, **kargs, &block)
|
10
10
|
path ||= default_base_path
|
11
|
-
|
12
|
-
ap = access_point(path)
|
11
|
+
#ap = access_point(path)
|
13
12
|
request(*path, "contractorEntities") do
|
14
|
-
|
15
|
-
client.query(kargs, &basic_block)
|
13
|
+
graphql_query(**kargs, &basic_block(&block))
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
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.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|