ecoportal-api-graphql 0.1.11 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -9
  3. data/ecoportal-api-graphql.gemspec +1 -1
  4. data/lib/ecoportal/api/common/graphql/query_integration.rb +5 -4
  5. data/lib/ecoportal/api/graphql/base/location_node.rb +15 -0
  6. data/lib/ecoportal/api/graphql/base/location_structure.rb +21 -0
  7. data/lib/ecoportal/api/graphql/base.rb +2 -10
  8. data/lib/ecoportal/api/graphql/builder/location_structure.rb +29 -0
  9. data/lib/ecoportal/api/graphql/builder.rb +10 -0
  10. data/lib/ecoportal/api/graphql/connection/action.rb +1 -1
  11. data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +1 -1
  12. data/lib/ecoportal/api/graphql/connection/person_member.rb +1 -1
  13. data/lib/ecoportal/api/graphql/error/locations_error.rb +13 -0
  14. data/lib/ecoportal/api/graphql/error/locations_validation_error.rb +11 -0
  15. data/lib/ecoportal/api/graphql/{base → error}/validation_errors.rb +1 -1
  16. data/lib/ecoportal/api/graphql/error.rb +12 -0
  17. data/lib/ecoportal/api/graphql/fragment/location_node.rb +20 -0
  18. data/lib/ecoportal/api/graphql/fragment.rb +1 -1
  19. data/lib/ecoportal/api/graphql/helpers/{tag_tree.rb → locations_tree.rb} +10 -3
  20. data/lib/ecoportal/api/graphql/helpers.rb +1 -1
  21. data/lib/ecoportal/api/graphql/input/contractor_entity/create.rb +16 -0
  22. data/lib/ecoportal/api/graphql/input/contractor_entity/destroy.rb +13 -0
  23. data/lib/ecoportal/api/graphql/input/{update_contractor_entity.rb → contractor_entity/update.rb} +1 -1
  24. data/lib/ecoportal/api/graphql/input/contractor_entity.rb +14 -0
  25. data/lib/ecoportal/api/graphql/{base/id_diff_input.rb → input/id_diff.rb} +2 -2
  26. data/lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb +48 -0
  27. data/lib/ecoportal/api/graphql/input/location_structure/archive_command.rb +13 -0
  28. data/lib/ecoportal/api/graphql/input/location_structure/command_interface.rb +26 -0
  29. data/lib/ecoportal/api/graphql/input/location_structure/delete_command.rb +13 -0
  30. data/lib/ecoportal/api/graphql/input/location_structure/insert_command.rb +13 -0
  31. data/lib/ecoportal/api/graphql/input/location_structure/move_command.rb +14 -0
  32. data/lib/ecoportal/api/graphql/input/location_structure/reorder_command.rb +13 -0
  33. data/lib/ecoportal/api/graphql/input/location_structure/unarchive_command.rb +13 -0
  34. data/lib/ecoportal/api/graphql/input/location_structure/update_command.rb +14 -0
  35. data/lib/ecoportal/api/graphql/input/location_structure.rb +20 -0
  36. data/lib/ecoportal/api/graphql/input.rb +3 -3
  37. data/lib/ecoportal/api/graphql/{base → logic}/connection.rb +1 -1
  38. data/lib/ecoportal/api/graphql/{base → logic}/mutation.rb +10 -1
  39. data/lib/ecoportal/api/graphql/{base → logic}/payload.rb +2 -2
  40. data/lib/ecoportal/api/graphql/{base → logic}/query.rb +3 -2
  41. data/lib/ecoportal/api/graphql/{base → logic}/query_array.rb +2 -2
  42. data/lib/ecoportal/api/graphql/{base → logic}/query_connection.rb +3 -3
  43. data/lib/ecoportal/api/graphql/logic.rb +15 -0
  44. data/lib/ecoportal/api/graphql/model/location_node.rb +11 -0
  45. data/lib/ecoportal/api/graphql/model/{tag_tree.rb → location_structure.rb} +2 -2
  46. data/lib/ecoportal/api/graphql/model/organization.rb +2 -2
  47. data/lib/ecoportal/api/graphql/model.rb +2 -2
  48. data/lib/ecoportal/api/graphql/mutation/contractor_entity/create.rb +40 -0
  49. data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +14 -0
  50. data/lib/ecoportal/api/graphql/mutation/location_structure/apply_commands.rb +61 -0
  51. data/lib/ecoportal/api/graphql/mutation/location_structure.rb +12 -0
  52. data/lib/ecoportal/api/graphql/mutation.rb +2 -1
  53. data/lib/ecoportal/api/graphql/payload/contractor_entity/create.rb +13 -0
  54. data/lib/ecoportal/api/graphql/payload/contractor_entity/destroy.rb +12 -0
  55. data/lib/ecoportal/api/graphql/payload/contractor_entity/update.rb +12 -0
  56. data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +14 -0
  57. data/lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb +25 -0
  58. data/lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb +15 -0
  59. data/lib/ecoportal/api/graphql/payload/location_structure/command_interface.rb +14 -0
  60. data/lib/ecoportal/api/graphql/payload/location_structure.rb +14 -0
  61. data/lib/ecoportal/api/graphql/payload.rb +2 -3
  62. data/lib/ecoportal/api/graphql/query/actions.rb +1 -1
  63. data/lib/ecoportal/api/graphql/query/contractor_entities.rb +1 -1
  64. data/lib/ecoportal/api/graphql/query/{tag_tree.rb → location_structure.rb} +12 -8
  65. data/lib/ecoportal/api/graphql/query/location_structures.rb +46 -0
  66. data/lib/ecoportal/api/graphql/query.rb +2 -2
  67. data/lib/ecoportal/api/graphql.rb +9 -2
  68. data/lib/ecoportal/api/graphql_version.rb +1 -1
  69. data/tests/loc_structure_get.rb +11 -0
  70. data/tests/loc_structure_update.rb +51 -0
  71. data/tests/loc_structures_get.rb +15 -0
  72. data/tests/local_libs.rb +2 -2
  73. metadata +63 -37
  74. data/lib/ecoportal/api/graphql/base/tag_tree.rb +0 -20
  75. data/lib/ecoportal/api/graphql/base/tag_tree_node.rb +0 -13
  76. data/lib/ecoportal/api/graphql/fragment/tag_tree_node.rb +0 -16
  77. data/lib/ecoportal/api/graphql/input/create_contractor_entity.rb +0 -14
  78. data/lib/ecoportal/api/graphql/input/destroy_contractor_entity.rb +0 -11
  79. data/lib/ecoportal/api/graphql/model/tag_tree_node.rb +0 -10
  80. data/lib/ecoportal/api/graphql/mutation/create_contractor_entity.rb +0 -38
  81. data/lib/ecoportal/api/graphql/payload/create_contractor_entity.rb +0 -11
  82. data/lib/ecoportal/api/graphql/payload/destroy_contractor_entity.rb +0 -10
  83. data/lib/ecoportal/api/graphql/payload/update_contractor_entity.rb +0 -10
  84. data/lib/ecoportal/api/graphql/query/tag_trees.rb +0 -37
  85. data/tests/tagtree_get.rb +0 -7
  86. data/tests/tagtrees_get.rb +0 -7
  87. /data/tests/{create_contractor_entity.rb → contractor_entity_create.rb} +0 -0
@@ -0,0 +1,51 @@
1
+ require_relative 'local_libs'
2
+
3
+ STRUCT_ID = "592642a4ae0c6a00236b110d" # mini test
4
+ # STRUCT_ID = "626745bcba616a001f7e5011" # wcc
5
+
6
+ api = Ecoportal::API::GraphQL.new
7
+
8
+ # DESIRED DESIGN: (to review: it might be that draft tree model already stores the commands?)
9
+ # tree = api.currentOrganization.LocationStructure(id: STRUCT_ID)
10
+ # node = tree.node["SYDNEY"]
11
+ # node.name = "Sydney City"
12
+ # tree.node["UPS"].move("AUCKLAND") # or tree.move("UPS", to: "AUCKLAND")
13
+ # tree.node["FFFF."].delete
14
+ # tree.node["UPS"].insert("CHILD", name: "Child").insert("GRAND CHILD", name: "Grand Child")
15
+ # tree.change_commands # => return Ecoportal::API::GraphQL::Input::ApplyCommands
16
+
17
+ INPUT = {
18
+ change: {
19
+ clientMutationId: "",
20
+ id: STRUCT_ID,
21
+ commands: [
22
+ { update: { nodeId: "SYDNEY", name: "Sydney City" } },
23
+ { move: { nodeId: "UPS", parentId: "AUCKLAND" } },
24
+ { archive: { nodeId: "FFFF." } },
25
+ { insert: { parentId: "UPS", nodeId: "CHILD", name: "Child" } },
26
+ { insert: { parentId: "CHILD", nodeId: "GRAND CHILD", name: "Grand Child" } }
27
+ ]
28
+ },
29
+ revert: {
30
+ clientMutationId: "",
31
+ id: STRUCT_ID,
32
+ commands: [
33
+ { update: { nodeId: "SYDNEY", name: "Sydney" } },
34
+ { move: { nodeId: "UPS", parentId: "SUB'TAGs" } },
35
+ { unarchive: { nodeId: "FFFF." } },
36
+ { archive: { nodeId: "CHILD" } }
37
+ ]
38
+ }
39
+ }
40
+
41
+ operation = :change
42
+ response = api.locationStructure.applyCommands(input: INPUT[operation])
43
+
44
+ if response.success? && structure = response.structure
45
+ puts "Applied '#{operation}' changes to '#{structure.name}' structure:"
46
+ pp structure.treeify
47
+ end
48
+
49
+ puts "Some more feedback:"
50
+ #pp response.results.as_json
51
+ pp response.results.map(&:as_json)
@@ -0,0 +1,15 @@
1
+ require_relative 'local_libs'
2
+
3
+ api = Ecoportal::API::GraphQL.new
4
+ kargs = {
5
+ includeArchived: false,
6
+ includeUnpublished: false
7
+ }
8
+ trees = api.currentOrganization.LocationStructures(**kargs)
9
+ trees.each_with_index do |tree, idx|
10
+ puts "#{tree.weight}. '#{tree.name}' (#{tree.id})"
11
+ end
12
+
13
+ trees.each do |tree|
14
+ pp tree.treeify
15
+ end
data/tests/local_libs.rb CHANGED
@@ -12,8 +12,8 @@ $LOAD_PATH.unshift File.expand_path(api_v2_path)
12
12
  #require 'ecoportal/api-v2'
13
13
  require File.join(base_dir,'/ecoportal-api-v2/lib/ecoportal/api-v2')
14
14
 
15
- # $LOAD_PATH.unshift File.join(base_dir,'/graphlient/lib')
16
- # require File.join(base_dir,'/graphlient/lib/graphlient')
15
+ $LOAD_PATH.unshift File.join(base_dir,'/graphlient/lib')
16
+ require File.join(base_dir,'/graphlient/lib/graphlient')
17
17
 
18
18
  graphql = File.join(base_dir,'/ecoportal-api-graphql/lib')
19
19
  $LOAD_PATH.unshift File.expand_path(graphql)
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.11
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-29 00:00:00.000000000 Z
11
+ date: 2023-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -130,20 +130,20 @@ dependencies:
130
130
  requirements:
131
131
  - - ">="
132
132
  - !ruby/object:Gem::Version
133
- version: 0.9.7
133
+ version: 1.0.1
134
134
  - - "<"
135
135
  - !ruby/object:Gem::Version
136
- version: '0.10'
136
+ version: '1.1'
137
137
  type: :runtime
138
138
  prerelease: false
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- version: 0.9.7
143
+ version: 1.0.1
144
144
  - - "<"
145
145
  - !ruby/object:Gem::Version
146
- version: '0.10'
146
+ version: '1.1'
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: graphlient
149
149
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +164,7 @@ dependencies:
164
164
  - - "<"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0.8'
167
- description:
167
+ description:
168
168
  email:
169
169
  - oscar@ecoportal.co.nz
170
170
  executables: []
@@ -200,45 +200,62 @@ files:
200
200
  - lib/ecoportal/api/graphql/base.rb
201
201
  - lib/ecoportal/api/graphql/base/action.rb
202
202
  - lib/ecoportal/api/graphql/base/action_category.rb
203
- - lib/ecoportal/api/graphql/base/connection.rb
204
203
  - lib/ecoportal/api/graphql/base/contractor_entity.rb
205
204
  - lib/ecoportal/api/graphql/base/date_time.rb
206
205
  - lib/ecoportal/api/graphql/base/field.rb
207
206
  - lib/ecoportal/api/graphql/base/file_attachment.rb
208
207
  - lib/ecoportal/api/graphql/base/file_container.rb
209
- - lib/ecoportal/api/graphql/base/id_diff_input.rb
208
+ - lib/ecoportal/api/graphql/base/location_node.rb
209
+ - lib/ecoportal/api/graphql/base/location_structure.rb
210
210
  - lib/ecoportal/api/graphql/base/model.rb
211
- - lib/ecoportal/api/graphql/base/mutation.rb
212
211
  - lib/ecoportal/api/graphql/base/organization.rb
213
212
  - lib/ecoportal/api/graphql/base/page.rb
214
213
  - lib/ecoportal/api/graphql/base/page_info.rb
215
- - lib/ecoportal/api/graphql/base/payload.rb
216
214
  - lib/ecoportal/api/graphql/base/person_member.rb
217
- - lib/ecoportal/api/graphql/base/query.rb
218
- - lib/ecoportal/api/graphql/base/query_array.rb
219
- - lib/ecoportal/api/graphql/base/query_connection.rb
220
215
  - lib/ecoportal/api/graphql/base/resource.rb
221
- - lib/ecoportal/api/graphql/base/tag_tree.rb
222
- - lib/ecoportal/api/graphql/base/tag_tree_node.rb
223
- - lib/ecoportal/api/graphql/base/validation_errors.rb
216
+ - lib/ecoportal/api/graphql/builder.rb
217
+ - lib/ecoportal/api/graphql/builder/location_structure.rb
224
218
  - lib/ecoportal/api/graphql/connection.rb
225
219
  - lib/ecoportal/api/graphql/connection/action.rb
226
220
  - lib/ecoportal/api/graphql/connection/contractor_entity.rb
227
221
  - lib/ecoportal/api/graphql/connection/person_member.rb
222
+ - lib/ecoportal/api/graphql/error.rb
223
+ - lib/ecoportal/api/graphql/error/locations_error.rb
224
+ - lib/ecoportal/api/graphql/error/locations_validation_error.rb
225
+ - lib/ecoportal/api/graphql/error/validation_errors.rb
228
226
  - lib/ecoportal/api/graphql/fragment.rb
229
227
  - lib/ecoportal/api/graphql/fragment/action.rb
230
228
  - lib/ecoportal/api/graphql/fragment/contractor_entity.rb
229
+ - lib/ecoportal/api/graphql/fragment/location_node.rb
231
230
  - lib/ecoportal/api/graphql/fragment/pagination.rb
232
- - lib/ecoportal/api/graphql/fragment/tag_tree_node.rb
233
231
  - lib/ecoportal/api/graphql/helpers.rb
234
- - lib/ecoportal/api/graphql/helpers/tag_tree.rb
232
+ - lib/ecoportal/api/graphql/helpers/locations_tree.rb
235
233
  - lib/ecoportal/api/graphql/input.rb
236
- - lib/ecoportal/api/graphql/input/create_contractor_entity.rb
237
- - lib/ecoportal/api/graphql/input/destroy_contractor_entity.rb
234
+ - lib/ecoportal/api/graphql/input/contractor_entity.rb
235
+ - lib/ecoportal/api/graphql/input/contractor_entity/create.rb
236
+ - lib/ecoportal/api/graphql/input/contractor_entity/destroy.rb
237
+ - lib/ecoportal/api/graphql/input/contractor_entity/update.rb
238
+ - lib/ecoportal/api/graphql/input/id_diff.rb
239
+ - lib/ecoportal/api/graphql/input/location_structure.rb
240
+ - lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb
241
+ - lib/ecoportal/api/graphql/input/location_structure/archive_command.rb
242
+ - lib/ecoportal/api/graphql/input/location_structure/command_interface.rb
243
+ - lib/ecoportal/api/graphql/input/location_structure/delete_command.rb
244
+ - lib/ecoportal/api/graphql/input/location_structure/insert_command.rb
245
+ - lib/ecoportal/api/graphql/input/location_structure/move_command.rb
246
+ - lib/ecoportal/api/graphql/input/location_structure/reorder_command.rb
247
+ - lib/ecoportal/api/graphql/input/location_structure/unarchive_command.rb
248
+ - lib/ecoportal/api/graphql/input/location_structure/update_command.rb
238
249
  - lib/ecoportal/api/graphql/input/search.rb
239
250
  - lib/ecoportal/api/graphql/input/search_filter.rb
240
251
  - lib/ecoportal/api/graphql/input/search_sorter.rb
241
- - lib/ecoportal/api/graphql/input/update_contractor_entity.rb
252
+ - lib/ecoportal/api/graphql/logic.rb
253
+ - lib/ecoportal/api/graphql/logic/connection.rb
254
+ - lib/ecoportal/api/graphql/logic/mutation.rb
255
+ - lib/ecoportal/api/graphql/logic/payload.rb
256
+ - lib/ecoportal/api/graphql/logic/query.rb
257
+ - lib/ecoportal/api/graphql/logic/query_array.rb
258
+ - lib/ecoportal/api/graphql/logic/query_connection.rb
242
259
  - lib/ecoportal/api/graphql/model.rb
243
260
  - lib/ecoportal/api/graphql/model/account.rb
244
261
  - lib/ecoportal/api/graphql/model/action.rb
@@ -246,36 +263,45 @@ files:
246
263
  - lib/ecoportal/api/graphql/model/field.rb
247
264
  - lib/ecoportal/api/graphql/model/file_attachment.rb
248
265
  - lib/ecoportal/api/graphql/model/file_container.rb
266
+ - lib/ecoportal/api/graphql/model/location_node.rb
267
+ - lib/ecoportal/api/graphql/model/location_structure.rb
249
268
  - lib/ecoportal/api/graphql/model/organization.rb
250
269
  - lib/ecoportal/api/graphql/model/page.rb
251
270
  - lib/ecoportal/api/graphql/model/person_member.rb
252
271
  - lib/ecoportal/api/graphql/model/resource.rb
253
- - lib/ecoportal/api/graphql/model/tag_tree.rb
254
- - lib/ecoportal/api/graphql/model/tag_tree_node.rb
255
272
  - lib/ecoportal/api/graphql/model/user.rb
256
273
  - lib/ecoportal/api/graphql/mutation.rb
257
- - lib/ecoportal/api/graphql/mutation/create_contractor_entity.rb
274
+ - lib/ecoportal/api/graphql/mutation/contractor_entity.rb
275
+ - lib/ecoportal/api/graphql/mutation/contractor_entity/create.rb
276
+ - lib/ecoportal/api/graphql/mutation/location_structure.rb
277
+ - lib/ecoportal/api/graphql/mutation/location_structure/apply_commands.rb
258
278
  - lib/ecoportal/api/graphql/payload.rb
259
- - lib/ecoportal/api/graphql/payload/create_contractor_entity.rb
260
- - lib/ecoportal/api/graphql/payload/destroy_contractor_entity.rb
261
- - lib/ecoportal/api/graphql/payload/update_contractor_entity.rb
279
+ - lib/ecoportal/api/graphql/payload/contractor_entity.rb
280
+ - lib/ecoportal/api/graphql/payload/contractor_entity/create.rb
281
+ - lib/ecoportal/api/graphql/payload/contractor_entity/destroy.rb
282
+ - lib/ecoportal/api/graphql/payload/contractor_entity/update.rb
283
+ - lib/ecoportal/api/graphql/payload/location_structure.rb
284
+ - lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb
285
+ - lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb
286
+ - lib/ecoportal/api/graphql/payload/location_structure/command_interface.rb
262
287
  - lib/ecoportal/api/graphql/query.rb
263
288
  - lib/ecoportal/api/graphql/query/actions.rb
264
289
  - lib/ecoportal/api/graphql/query/contractor_entities.rb
265
- - lib/ecoportal/api/graphql/query/tag_tree.rb
266
- - lib/ecoportal/api/graphql/query/tag_trees.rb
290
+ - lib/ecoportal/api/graphql/query/location_structure.rb
291
+ - lib/ecoportal/api/graphql/query/location_structures.rb
267
292
  - lib/ecoportal/api/graphql_version.rb
268
293
  - tests/actions_get.rb
269
294
  - tests/contractor_entities_get.rb
270
- - tests/create_contractor_entity.rb
295
+ - tests/contractor_entity_create.rb
296
+ - tests/loc_structure_get.rb
297
+ - tests/loc_structure_update.rb
298
+ - tests/loc_structures_get.rb
271
299
  - tests/local_libs.rb
272
- - tests/tagtree_get.rb
273
- - tests/tagtrees_get.rb
274
300
  homepage: https://www.ecoportal.com
275
301
  licenses:
276
302
  - MIT
277
303
  metadata: {}
278
- post_install_message:
304
+ post_install_message:
279
305
  rdoc_options: []
280
306
  require_paths:
281
307
  - lib
@@ -290,8 +316,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
316
  - !ruby/object:Gem::Version
291
317
  version: '0'
292
318
  requirements: []
293
- rubygems_version: 3.0.3
294
- signing_key:
319
+ rubygems_version: 3.1.4
320
+ signing_key:
295
321
  specification_version: 4
296
322
  summary: A collection of helpers for interacting with the ecoPortal GraphQL API
297
323
  test_files: []
@@ -1,20 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Base
5
- class TagTree < Ecoportal::API::GraphQL::Base::Model
6
- extend Ecoportal::API::GraphQL::Helpers::TagTree
7
-
8
- passkey :id
9
- passthrough :name
10
- passboolean :visitorManagementEnabled
11
- embeds_many :nodes, klass: Ecoportal::API::GraphQL::Base::TagTreeNode, order_key: :weight
12
-
13
- def treeify
14
- self.class.treeify(nodes)
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,13 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Base
5
- class TagTreeNode < Ecoportal::API::GraphQL::Base::Model
6
- passkey :id
7
- passthrough :tag, :parent, :parentId
8
- passboolean :enabledLocationCode
9
- end
10
- end
11
- end
12
- end
13
- end
@@ -1,16 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- class Fragment
5
- fragment :TagTreeNode, <<~'GRAPHQL'
6
- fragment on TagTreeNode {
7
- id
8
- parentId
9
- tag
10
- weight
11
- }
12
- GRAPHQL
13
- end
14
- end
15
- end
16
- end
@@ -1,14 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Input
5
- class CreateContractorEntity < Ecoportal::API::GraphQL::Base::ContractorEntity
6
- passthrough :clientMutationId
7
- class_resolver :id_diff_input, "Ecoportal::API::GraphQL::Base::IdDiffInput"
8
- embeds_one :associatedPeopleIds, klass: :id_diff_input
9
- embeds_one :leadContractorIds, klass: :id_diff_input
10
- end
11
- end
12
- end
13
- end
14
- end
@@ -1,11 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Input
5
- class DestroyContractorEntity < Ecoportal::API::GraphQL::Base::Model
6
- passkey :id
7
- end
8
- end
9
- end
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Model
5
- class TagTreeNode < Ecoportal::API::GraphQL::Base::TagTreeNode
6
- end
7
- end
8
- end
9
- end
10
- end
@@ -1,38 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Mutation
5
- class CreateContractorEntity < Ecoportal::API::GraphQL::Base::Mutation
6
- field_name :createContractorEntity
7
-
8
- #class_resolver :item_class, Ecoportal::API::GraphQL::Model::ContractorEntity
9
- class_resolver :payload_class, Ecoportal::API::GraphQL::Payload::CreateContractorEntity
10
-
11
- private
12
-
13
- def basic_block(&block)
14
- payload_block = block || default_payload_block
15
- Proc.new {
16
- mutation(input: :CreateContractorEntityInput!) {
17
- createContractorEntity(input: :input, &payload_block)
18
- }
19
- }
20
- end
21
-
22
- def default_payload_block
23
- Proc.new {
24
- clientMutationId
25
- errors {
26
- details
27
- fullMessages
28
- }
29
- item {
30
- ___Fragment__ContractorEntity
31
- }
32
- }
33
- end
34
- end
35
- end
36
- end
37
- end
38
- end
@@ -1,11 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Payload
5
- class CreateContractorEntity < Ecoportal::API::GraphQL::Base::Payload
6
- class_resolver :item_class, "Ecoportal::API::GraphQL::Model::ContractorEntity"
7
- end
8
- end
9
- end
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Payload
5
- class DestroyContractorEntity < Ecoportal::API::GraphQL::Payload::CreateContractorEntity
6
- end
7
- end
8
- end
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Payload
5
- class UpdateContractorEntity < Ecoportal::API::GraphQL::Payload::CreateContractorEntity
6
- end
7
- end
8
- end
9
- end
10
- end
@@ -1,37 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Query
5
- class TagTrees < Ecoportal::API::GraphQL::Base::QueryArray
6
- field_name :tagTrees
7
-
8
- class_resolver :item_class, Ecoportal::API::GraphQL::Model::TagTree
9
-
10
- private
11
-
12
- def basic_block(&block)
13
- final_block = block || default_tree_block
14
- Proc.new {
15
- query {
16
- currentOrganization {
17
- tagTrees(&final_block)
18
- }
19
- }
20
- }
21
- end
22
-
23
- def default_tree_block
24
- Proc.new {
25
- id
26
- name
27
- visitorManagementEnabled
28
- nodes {
29
- ___Ecoportal__API__GraphQL__Fragment__TagTreeNode
30
- }
31
- }
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
data/tests/tagtree_get.rb DELETED
@@ -1,7 +0,0 @@
1
- require_relative 'local_libs'
2
-
3
- api = Ecoportal::API::GraphQL.new
4
- api.currentOrganization.tagTree(id: "6154d517860cb700112b7c99").tap do |tree|
5
- puts "'#{tree.name}' (#{tree.id})"
6
- pp tree.treeify
7
- end
@@ -1,7 +0,0 @@
1
- require_relative 'local_libs'
2
-
3
- api = Ecoportal::API::GraphQL.new
4
- api.currentOrganization.tagTrees.each_with_index do |tree, idx|
5
- puts "#{idx+1}. '#{tree.name}' (#{tree.id})"
6
- pp tree.treeify
7
- end