ecoportal-api-graphql 0.1.3 → 0.1.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: 07ba83146627efb03fc8dff405390cafd4f5cfdb4ad2f3bc4411a49d42d8a259
4
- data.tar.gz: 7be60f892e80c06418312fe6f566cc57b7f8c23bd45ebc339305439df8e5ca80
3
+ metadata.gz: 5ebcd32d52a269e3f9b9348fdb9e3ca80b3c07a75872e67759d978cd57c233d2
4
+ data.tar.gz: 80bbb9bbaa4a8a420b028cb3f5d4f1685621e176a239710024cede3ab12eed87
5
5
  SHA512:
6
- metadata.gz: 59d820cad74807d561595cb157d92ec16094a028c1354501c8e5ea43efc4f962cee87f10bb0689055acd81839902319db4903bcd5ce8b4c1bbd84f97ff1fd2a2
7
- data.tar.gz: e60dea5941855d499dbdaa60f2f835607612560a11b047623adbbd5f71a646492c37df234d265ac05a932bd3e784194ac921580329b35b1aaf5a1e418b5b2af6
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] - 2022-09-xx
4
+ ## [0.1.5] - 2022-09-xx
5
5
 
6
6
  ### Added
7
7
 
@@ -16,7 +16,13 @@ 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
19
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
+
20
26
  ## [0.1.3] - 2022-09-15
21
27
 
22
28
  ### Fixed
@@ -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 each(**kargs, &block)
24
- return to_enum(:each, **kargs) unless block
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
- next client.query(kargs, &basic_block(&block)) if block_given?
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
- kargs = self.class.slice_params(kargs)
12
- ap = access_point(path)
11
+ #ap = access_point(path)
13
12
  request(*path, "contractorEntities") do
14
- next client.query(kargs, &basic_block(&block)) if block_given?
15
- client.query(kargs, &basic_block)
13
+ graphql_query(**kargs, &basic_block(&block))
16
14
  end
17
15
  end
18
16
 
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GRAPQL_VERSION = "0.1.3"
3
+ GRAPQL_VERSION = "0.1.4"
4
4
  end
5
5
  end
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.3
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-15 00:00:00.000000000 Z
11
+ date: 2022-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler