ecoportal-api-graphql 1.1.1 → 1.3.1

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -1
  3. data/ecoportal-api-graphql.gemspec +2 -2
  4. data/lib/ecoportal/api/graphql/base/action.rb +1 -1
  5. data/lib/ecoportal/api/graphql/base/action_category.rb +1 -1
  6. data/lib/ecoportal/api/graphql/base/contractor_entity.rb +1 -1
  7. data/lib/ecoportal/api/graphql/base/date_time.rb +1 -1
  8. data/lib/ecoportal/api/graphql/base/field.rb +1 -1
  9. data/lib/ecoportal/api/graphql/base/file_attachment.rb +1 -1
  10. data/lib/ecoportal/api/graphql/base/file_container.rb +1 -1
  11. data/lib/ecoportal/api/graphql/base/location_classification_type.rb +1 -1
  12. data/lib/ecoportal/api/graphql/base/location_node.rb +6 -13
  13. data/lib/ecoportal/api/graphql/base/location_structure.rb +1 -1
  14. data/lib/ecoportal/api/graphql/base/organization.rb +1 -1
  15. data/lib/ecoportal/api/graphql/base/page.rb +1 -5
  16. data/lib/ecoportal/api/graphql/base/page_info.rb +1 -1
  17. data/lib/ecoportal/api/graphql/base/person_member.rb +1 -1
  18. data/lib/ecoportal/api/graphql/base/resource.rb +1 -1
  19. data/lib/ecoportal/api/graphql/base.rb +0 -1
  20. data/lib/ecoportal/api/graphql/base_model.rb +11 -0
  21. data/lib/ecoportal/api/graphql/error/locations_error.rb +1 -1
  22. data/lib/ecoportal/api/graphql/error/locations_validation_error.rb +1 -1
  23. data/lib/ecoportal/api/graphql/error/validation_errors.rb +1 -1
  24. data/lib/ecoportal/api/graphql/fragment/action.rb +5 -3
  25. data/lib/ecoportal/api/graphql/fragment.rb +6 -3
  26. data/lib/ecoportal/api/graphql/input/action/archive.rb +1 -1
  27. data/lib/ecoportal/api/graphql/input/contractor_entity/destroy.rb +1 -1
  28. data/lib/ecoportal/api/graphql/input/id_diff.rb +1 -1
  29. data/lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb +1 -1
  30. data/lib/ecoportal/api/graphql/input/location_structure/command_interface.rb +1 -1
  31. data/lib/ecoportal/api/graphql/input/search.rb +1 -1
  32. data/lib/ecoportal/api/graphql/input/search_filter.rb +1 -1
  33. data/lib/ecoportal/api/graphql/input/search_sorter.rb +1 -1
  34. data/lib/ecoportal/api/graphql/interface/base_page.rb +58 -0
  35. data/lib/ecoportal/api/graphql/interface/location_node.rb +39 -0
  36. data/lib/ecoportal/api/graphql/interface.rb +11 -0
  37. data/lib/ecoportal/api/graphql/logic/connection.rb +1 -1
  38. data/lib/ecoportal/api/graphql/logic/mutation.rb +1 -1
  39. data/lib/ecoportal/api/graphql/logic/payload.rb +1 -1
  40. data/lib/ecoportal/api/graphql/model/account.rb +1 -1
  41. data/lib/ecoportal/api/graphql/model/location_node.rb +5 -10
  42. data/lib/ecoportal/api/graphql/model/page.rb +6 -0
  43. data/lib/ecoportal/api/graphql/model/resource.rb +3 -2
  44. data/lib/ecoportal/api/graphql/model/user.rb +1 -1
  45. data/lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb +1 -1
  46. data/lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb +1 -1
  47. data/lib/ecoportal/api/graphql/payload/location_structure/command_interface.rb +1 -1
  48. data/lib/ecoportal/api/graphql.rb +2 -0
  49. data/lib/ecoportal/api/graphql_version.rb +1 -1
  50. metadata +12 -9
  51. data/lib/ecoportal/api/graphql/base/model.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d43b5c70e8ce94e96f2028bcc80b6bdf45ac8f78afa7a1689b2149e2175d39db
4
- data.tar.gz: c7e932aea0d5b4976677cecb565a64c3523b2cd8af2fac49e7ecf35f8265d636
3
+ metadata.gz: 7b3b994c1c3caf29f00c91a3e30ec6bd90a25f11c3da7a4de7edf7a44d43f936
4
+ data.tar.gz: 5dbd35520022fac826e7526daa4c33d1e009c21ee6df010d584b8ccf02b14f0b
5
5
  SHA512:
6
- metadata.gz: dbd441319d44294084754bcc03f8660b6361930617ae23bf66faeae3d2f204d2c28d0523b63fe0985629cd196c7445ff0eaa01c18740baf02522c7c37f982f65
7
- data.tar.gz: 9cae64f7110b5df6e3995ff36af69220b3e19cdd1cb7f8e1914128fdffadea5a916e429b2e28e009be618a709d5765b51419d441f1fd576135ae74f19a1d6292
6
+ metadata.gz: 7e162e19fc732160febb41db9e0d1f397a355260b17e2ad43b960f8a1da34a8b469aeb2a146b6e80f73e7ac0e41254d715591d76d9fbb615b7be725cb8156588
7
+ data.tar.gz: cd480b0df06aae25e7d54a4e549fdfbf6ee0d57e5c2152ce4446fb563357266cbd785d7066fb03d6b740b1b3ac13e3ab71b85220be2142839f773f467be4b61c
data/CHANGELOG.md CHANGED
@@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file.
9
9
  - Analyse how to "DSL" currentOrganization.action.activities
10
10
  - review `path` tracking
11
11
 
12
- ## [1.1.2] - 2025-05-xx
12
+ ## [1.4.1] - 2025-05-xx
13
13
 
14
14
  ### Added
15
15
 
@@ -17,6 +17,30 @@ All notable changes to this project will be documented in this file.
17
17
 
18
18
  ### Fixed
19
19
 
20
+ ## [1.3.1] - 2025-06-xx
21
+
22
+ ### Changed
23
+
24
+ - upgraded gem dependencies
25
+ - **Moded** `Ecoportal::API::GraphQL::Base::Model` to
26
+ - > `Ecoportal::API::GraphQL::BaseModel`
27
+ - **Added** `Interface::LocationNode`
28
+ - **Added** `Interface::BasePage`
29
+
30
+ ### Fixed
31
+
32
+ - **Fragments**
33
+ - `Action` fragment to use `PageUnion` (**upgrade**)
34
+ - **Memoize** fragments.
35
+ - Add what fragment failed in the **error**.
36
+
37
+ ## [1.2.1] - 2025-05-16
38
+
39
+ ### Changed
40
+
41
+ - upgrade `ecoportal-api` gem
42
+ - upgrade `ecoportal-api-v2` gem
43
+
20
44
  ## [1.1.1] - 2025-05-14
21
45
 
22
46
  ### Added
@@ -32,8 +32,8 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'rubocop-rake', '~> 0'
33
33
  spec.add_development_dependency 'yard', '>= 0.9.34', '< 1'
34
34
 
35
- spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.9'
36
- spec.add_dependency 'ecoportal-api-v2', '~> 3.1', '>= 3.1.1'
35
+ spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.12'
36
+ spec.add_dependency 'ecoportal-api-v2', '~> 3.3', '>= 3.3.1'
37
37
  spec.add_dependency 'graphlient', '>= 0.8.0', '< 0.9'
38
38
  end
39
39
 
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class Action < Ecoportal::API::GraphQL::Base::Model
5
+ class Action < Ecoportal::API::GraphQL::BaseModel
6
6
  root!
7
7
 
8
8
  passkey :id
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class ActionCategory < Ecoportal::API::GraphQL::Base::Model
5
+ class ActionCategory < Ecoportal::API::GraphQL::BaseModel
6
6
  root!
7
7
 
8
8
  passkey :id
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class ContractorEntity < Ecoportal::API::GraphQL::Base::Model
5
+ class ContractorEntity < Ecoportal::API::GraphQL::BaseModel
6
6
  require 'ecoportal/api/graphql/base/contractor_entity/member_changes'
7
7
 
8
8
  include MemberChanges
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class DateTime < Ecoportal::API::GraphQL::Base::Model
5
+ class DateTime < Ecoportal::API::GraphQL::BaseModel
6
6
  passdate :dateTime
7
7
  passthrough :timeZone
8
8
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class Field < Ecoportal::API::GraphQL::Base::Model
5
+ class Field < Ecoportal::API::GraphQL::BaseModel
6
6
  passkey :id
7
7
  passthrough :label
8
8
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class FileAttachment < Ecoportal::API::GraphQL::Base::Model
5
+ class FileAttachment < Ecoportal::API::GraphQL::BaseModel
6
6
  passkey :id
7
7
  passthrough :attachmentFileSize, :attachmentFileName, :attachmentContentType
8
8
  passthrough :urlType, :activeName
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class FileContainer < Ecoportal::API::GraphQL::Base::Model
5
+ class FileContainer < Ecoportal::API::GraphQL::BaseModel
6
6
  passkey :id
7
7
  passthrough :name, :activeName
8
8
  passthrough :fileSize, :token, :activeVersionId
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class LocationClassificationType < Ecoportal::API::GraphQL::Base::Model
5
+ class LocationClassificationType < Ecoportal::API::GraphQL::BaseModel
6
6
  root!
7
7
 
8
8
  passkey :id
@@ -2,20 +2,13 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class LocationNode < Ecoportal::API::GraphQL::Base::Model
6
- root!
5
+ # LocationNodeType
6
+ class LocationNode < Ecoportal::API::GraphQL::Interface::LocationNode
7
+ passthrough :highlights
7
8
 
8
- passkey :id
9
- passthrough :name
10
- passthrough :weight
11
- embeds_one :parent, klass: Base::LocationNode, nullable: true
12
- passboolean :archived
13
- passthrough :archivedToken
14
- embeds_many :classifications, klass: Base::LocationClassificationType
15
-
16
- def parentId
17
- parent&.id
18
- end
9
+ embeds_one :parent, klass: self, nullable: true
10
+ embeds_many :ancestors, klass: self, read_only: true
11
+ embeds_many :children, klass: self, read_only: true
19
12
  end
20
13
  end
21
14
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class LocationStructure < Ecoportal::API::GraphQL::Base::Model
5
+ class LocationStructure < Ecoportal::API::GraphQL::BaseModel
6
6
  read_only!
7
7
 
8
8
  extend Ecoportal::API::GraphQL::Helpers::LocationsTree
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class Organization < Ecoportal::API::GraphQL::Base::Model
5
+ class Organization < Ecoportal::API::GraphQL::BaseModel
6
6
  root!
7
7
 
8
8
  passkey :id
@@ -2,11 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class Page < Ecoportal::API::GraphQL::Base::Model
6
- root!
7
-
8
- passkey :id
9
- passthrough :mouldCounter, :name
5
+ class Page < Ecoportal::API::GraphQL::Interface::BasePage
10
6
  end
11
7
  end
12
8
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class PageInfo < Ecoportal::API::GraphQL::Base::Model
5
+ class PageInfo < Ecoportal::API::GraphQL::BaseModel
6
6
  passthrough :startCursor, :endCursor
7
7
  passboolean :hasNextPage, :hasPreviousPage
8
8
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class PersonMember < Ecoportal::API::GraphQL::Base::Model
5
+ class PersonMember < Ecoportal::API::GraphQL::BaseModel
6
6
  root!
7
7
 
8
8
  passkey :id
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Base
5
- class Resource < Ecoportal::API::GraphQL::Base::Model
5
+ class Resource < Ecoportal::API::GraphQL::BaseModel
6
6
  passkey :id
7
7
  passthrough :fieldId, :pageId
8
8
  passarray :stageIds
@@ -7,7 +7,6 @@ module Ecoportal
7
7
  end
8
8
  end
9
9
 
10
- require 'ecoportal/api/graphql/base/model'
11
10
  require 'ecoportal/api/graphql/base/date_time'
12
11
  require 'ecoportal/api/graphql/base/page_info'
13
12
  require 'ecoportal/api/graphql/base/location_classification_type'
@@ -0,0 +1,11 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ class BaseModel < Ecoportal::API::Common::GraphQL::Model
5
+ class << self
6
+ attr_accessor :client
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Error
5
- class LocationsError < Ecoportal::API::GraphQL::Base::Model
5
+ class LocationsError < Ecoportal::API::GraphQL::BaseModel
6
6
  read_only!
7
7
 
8
8
  passthrough :message, :conflictingIds
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Error
5
- class LocationsValidationError < Ecoportal::API::GraphQL::Base::Model
5
+ class LocationsValidationError < Ecoportal::API::GraphQL::BaseModel
6
6
  read_only!
7
7
 
8
8
  passthrough :error, :message, :property
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Error
5
- class ValidationErrors < Ecoportal::API::GraphQL::Base::Model
5
+ class ValidationErrors < Ecoportal::API::GraphQL::BaseModel
6
6
  include Enumerable
7
7
 
8
8
  passthrough :details
@@ -50,9 +50,11 @@ module Ecoportal
50
50
  linkedResources {
51
51
  id
52
52
  page {
53
- id
54
- name
55
- mouldCounter
53
+ ... on BasePageInterface {
54
+ id
55
+ name
56
+ uid
57
+ }
56
58
  }
57
59
  }
58
60
  }
@@ -50,9 +50,12 @@ module Ecoportal
50
50
  end
51
51
 
52
52
  def parse
53
- fragments = self.class.fragments.each_with_object({}) do |(sym, heredoc), out|
54
- out[sym] = define(sym, heredoc, namespace: self.class)
55
- end
53
+ @fragments = self.class.fragments.
54
+ each_with_object({}) do |(sym, heredoc), out|
55
+ out[sym] = define(sym, heredoc, namespace: self.class)
56
+ rescue ::GraphQL::Client::ValidationError, ::Graphlient::Errors::ClientError => err
57
+ raise err.class, "On fragment #{sym} -- #{err.message}", cause: nil
58
+ end
56
59
  end
57
60
  end
58
61
  end
@@ -3,7 +3,7 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Input
5
5
  module Action
6
- class Archive < Ecoportal::API::GraphQL::Base::Model
6
+ class Archive < Ecoportal::API::GraphQL::BaseModel
7
7
  passkey :id
8
8
  passthrough :clientMutationId
9
9
  passthrough :updateMode
@@ -3,7 +3,7 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Input
5
5
  module ContractorEntity
6
- class Destroy < Ecoportal::API::GraphQL::Base::Model
6
+ class Destroy < Ecoportal::API::GraphQL::BaseModel
7
7
  passthrough :clientMutationId
8
8
  passkey :id
9
9
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Input
5
- class IdDiff < Ecoportal::API::GraphQL::Base::Model
5
+ class IdDiff < Ecoportal::API::GraphQL::BaseModel
6
6
  passarray :additions, :removals
7
7
  end
8
8
  end
@@ -3,7 +3,7 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Input
5
5
  module LocationStructure
6
- class ApplyCommands < Ecoportal::API::GraphQL::Base::Model
6
+ class ApplyCommands < Ecoportal::API::GraphQL::BaseModel
7
7
  passkey :id
8
8
  passthrough :clientMutationId
9
9
  passboolean :force
@@ -3,7 +3,7 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Input
5
5
  module LocationStructure
6
- class CommandInterface < Ecoportal::API::GraphQL::Base::Model
6
+ class CommandInterface < Ecoportal::API::GraphQL::BaseModel
7
7
  passkey :id
8
8
  passthrough :state
9
9
 
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Input
5
- class Search < Ecoportal::API::GraphQL::Base::Model
5
+ class Search < Ecoportal::API::GraphQL::BaseModel
6
6
  embeds_many :filters, enum_class: "Ecoportal::API::GraphQL::Input::SearchFilter"
7
7
  passthrough :query
8
8
  embeds_many :sorters, enum_class: "Ecoportal::API::GraphQL::Input::SearchSorter"
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Input
5
- class SearchFilter < Ecoportal::API::GraphQL::Base::Model
5
+ class SearchFilter < Ecoportal::API::GraphQL::BaseModel
6
6
  passthrough :id, :fieldName, :key, :operation
7
7
  passthrough :params, :path
8
8
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Input
5
- class SearchSorter < Ecoportal::API::GraphQL::Base::Model
5
+ class SearchSorter < Ecoportal::API::GraphQL::BaseModel
6
6
  passthrough :direction, :key, :missing
7
7
  end
8
8
  end
@@ -0,0 +1,58 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Interface
5
+ class BasePage < Ecoportal::API::GraphQL::BaseModel
6
+ passkey :id
7
+ passthrough :name, :uid
8
+ passthrough :icon
9
+
10
+ class_resolver :location_node_class, 'Ecoportal::API::GraphQL::Interface::LocationNode'
11
+ class_resolver :user_class, 'Ecoportal::API::GraphQL::Base::User'
12
+ # class_resolver :force_class, 'Ecoportal::API::GraphQL::Base::Force'
13
+ # class_resolver :task_class, 'Ecoportal::API::GraphQL::Interface::Task'
14
+ # class_resolver :theme_class, 'Ecoportal::API::GraphQL::Base::Theme'
15
+ # class_resolver :template_class, 'Ecoportal::API::GraphQL::Base::Template'
16
+ # class_resolver :register_class, 'Ecoportal::API::GraphQL::Base::Register'
17
+ class_resolver :organization_class, 'Ecoportal::API::GraphQL::Base::Organization'
18
+
19
+ passthrough :autoSelectedLocations
20
+ embeds_many :locations, klass: :location_node_class, read_only: true
21
+ embeds_many :allLocations, klass: :location_node_class, read_only: true
22
+ passarray :otherTags, :baseTags
23
+
24
+ # embeds_one :state, klass: 'BasePage::StateEnum', read_only: true
25
+ passthrough :state
26
+ # embeds_one :taskPriority, klass: 'BasePage::TaskPriorityEnum', read_only: true
27
+ passthrough :taskPriority
28
+
29
+
30
+ passthrough :patchVer
31
+
32
+ passboolean :archived
33
+ passdate :archivedAt
34
+
35
+ passthrough :timeZone
36
+ passdate :createdAt, :updatedAt
37
+ passthrough :creatorName, :lastUpdatedByName
38
+ # embeds_one :creator, klass: :user_class, read_only: true
39
+
40
+ passboolean :hasForces
41
+ # embeds_many :forces, klass: :force_class
42
+
43
+ # embeds_many :tasks, klass: :task_class, read_only: true
44
+ # embeds_many :activeTasks, klass: :task_class, read_only: true
45
+
46
+ # embeds_one :theme, klass: :theme_class
47
+
48
+ passthrough :sourceTemplateId
49
+ # embeds_one :template, klass: :template_class, read_only: true
50
+ # embeds_many :registers, klass: :register_class, read_only: true
51
+ # embeds_one :organization, klass: :organization_class, read_only: true
52
+
53
+ passboolean :inSystemPagesEnabled, :printingEnabled
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,39 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Interface
5
+ class LocationNode < Ecoportal::API::GraphQL::BaseModel
6
+ root!
7
+
8
+ class_resolver :location_classification_class, 'Ecoportal::API::GraphQL::Base::LocationClassificationType'
9
+
10
+ passkey :id
11
+ passthrough :name
12
+ embeds_many :classifications, klass: :location_classification_class
13
+
14
+ passthrough :weight
15
+
16
+ passboolean :archived
17
+ passthrough :archivedToken
18
+
19
+ passthrough :structureId
20
+
21
+ embeds_one :parent, klass: self, nullable: true
22
+ passthrough :parentObjectId
23
+
24
+ def parentId
25
+ parent&.id
26
+ end
27
+ alias_method :parent_id, :parentId
28
+
29
+ def parent_id_upcase
30
+ parent_id&.upcase
31
+ end
32
+
33
+ embeds_many :ancestors, klass: self, read_only: true
34
+ embeds_many :children, klass: self, read_only: true
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,11 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Interface
5
+ end
6
+ end
7
+ end
8
+ end
9
+
10
+ require_relative 'interface/location_node'
11
+ require_relative 'interface/base_page'
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Logic
5
- class Connection < Ecoportal::API::GraphQL::Base::Model
5
+ class Connection < Ecoportal::API::GraphQL::BaseModel
6
6
  class GenericNode
7
7
  def initialize(*_args, **_kargs)
8
8
  raise "Missuse error. You should define a node_class for a class that inherits from GraphqlConnection class."
@@ -39,7 +39,7 @@ module Ecoportal
39
39
 
40
40
  def as_input(value)
41
41
  case value
42
- when input_class, Ecoportal::API::GraphQL::Base::Model
42
+ when input_class, Ecoportal::API::GraphQL::BaseModel
43
43
  value.as_input
44
44
  when Hash
45
45
  value
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Logic
5
- class Payload < Ecoportal::API::GraphQL::Base::Model
5
+ class Payload < Ecoportal::API::GraphQL::BaseModel
6
6
  class GenericItem
7
7
  def initialize(*_args, **_kargs)
8
8
  raise "Missuse error. You should define a item_class for a class that inherits from GraphqlPayload class."
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Model
5
- class Account < Ecoportal::API::GraphQL::Base::Model
5
+ class Account < Ecoportal::API::GraphQL::BaseModel
6
6
  root!
7
7
 
8
8
  passkey :id
@@ -3,17 +3,12 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Model
5
5
  class LocationNode < Ecoportal::API::GraphQL::Base::LocationNode
6
- embeds_one :parent, klass: Model::LocationNode, nullable: true
7
- embeds_many :ancestors, read_only: true, klass: Model::LocationNode
6
+ # embeds_one :structure, klass: 'Model::LocationStructure'
7
+ # embeds_one :enabledLocationCode, klass: 'Model::LocationCode'
8
8
 
9
- def parentId
10
- parent&.id
11
- end
12
- alias_method :parent_id, :parentId
13
-
14
- def parent_id_upcase
15
- parent_id&.upcase
16
- end
9
+ embeds_one :parent, klass: self, nullable: true
10
+ embeds_many :ancestors, klass: self, read_only: true
11
+ embeds_many :children, klass: self, read_only: true
17
12
  end
18
13
  end
19
14
  end
@@ -3,6 +3,12 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Model
5
5
  class Page < Ecoportal::API::GraphQL::Base::Page
6
+ class_resolver :user_class, 'Ecoportal::API::GraphQL::Model::User'
7
+ # class_resolver :force_class, 'Ecoportal::API::GraphQL::Model::Force'
8
+ # class_resolver :theme_class, 'Ecoportal::API::GraphQL::Model::Theme'
9
+ # class_resolver :template_class, 'Ecoportal::API::GraphQL::Model::Template'
10
+ # class_resolver :register_class, 'Ecoportal::API::GraphQL::Model::Register'
11
+ class_resolver :organization_class, 'Ecoportal::API::GraphQL::Model::Organization'
6
12
  end
7
13
  end
8
14
  end
@@ -3,8 +3,9 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Model
5
5
  class Resource < Ecoportal::API::GraphQL::Base::Resource
6
- embeds_one :page, klass: "Ecoportal::API::GraphQL::Model::Page"
7
- embeds_one :field, klass: "Ecoportal::API::GraphQL::Model::Field"
6
+ embeds_one :page, klass: 'Ecoportal::API::GraphQL::Model::Page', read_only: true # PageUnion
7
+ embeds_one :field, klass: 'Ecoportal::API::GraphQL::Model::Field', read_only: true
8
+ # embeds_many :stages, klass: 'Ecoportal::API::GraphQL::Model::SimpleStage'
8
9
  end
9
10
  end
10
11
  end
@@ -2,7 +2,7 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Model
5
- class User < Ecoportal::API::GraphQL::Base::Model
5
+ class User < Ecoportal::API::GraphQL::BaseModel
6
6
  root!
7
7
 
8
8
  passkey :id
@@ -3,7 +3,7 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Payload
5
5
  module LocationStructure
6
- class ApplyCommands < Ecoportal::API::GraphQL::Base::Model
6
+ class ApplyCommands < Ecoportal::API::GraphQL::BaseModel
7
7
  read_only!
8
8
 
9
9
  passthrough :clientMutationId
@@ -3,7 +3,7 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Payload
5
5
  module LocationStructure
6
- class CommandExecutionResult < Ecoportal::API::GraphQL::Base::Model
6
+ class CommandExecutionResult < Ecoportal::API::GraphQL::BaseModel
7
7
  read_only!
8
8
 
9
9
  embeds_one :command, klass: Ecoportal::API::GraphQL::Payload::LocationStructure::CommandInterface
@@ -3,7 +3,7 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Payload
5
5
  module LocationStructure
6
- class CommandInterface < Ecoportal::API::GraphQL::Base::Model
6
+ class CommandInterface < Ecoportal::API::GraphQL::BaseModel
7
7
  passkey :id
8
8
  passthrough :state
9
9
  end
@@ -55,6 +55,8 @@ module Ecoportal
55
55
  end
56
56
 
57
57
  require 'ecoportal/api/graphql/helpers'
58
+ require 'ecoportal/api/graphql/base_model'
59
+ require 'ecoportal/api/graphql/interface'
58
60
  require 'ecoportal/api/graphql/base'
59
61
  require 'ecoportal/api/graphql/model'
60
62
  require 'ecoportal/api/graphql/error'
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GRAPQL_VERSION = '1.1.1'.freeze
3
+ GRAPQL_VERSION = '1.3.1'.freeze
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: 1.1.1
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-13 00:00:00.000000000 Z
11
+ date: 2025-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -141,7 +141,7 @@ dependencies:
141
141
  version: '0.10'
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
- version: 0.10.9
144
+ version: 0.10.12
145
145
  type: :runtime
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
@@ -151,27 +151,27 @@ dependencies:
151
151
  version: '0.10'
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
- version: 0.10.9
154
+ version: 0.10.12
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: ecoportal-api-v2
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
159
  - - "~>"
160
160
  - !ruby/object:Gem::Version
161
- version: '3.1'
161
+ version: '3.3'
162
162
  - - ">="
163
163
  - !ruby/object:Gem::Version
164
- version: 3.1.1
164
+ version: 3.3.1
165
165
  type: :runtime
166
166
  prerelease: false
167
167
  version_requirements: !ruby/object:Gem::Requirement
168
168
  requirements:
169
169
  - - "~>"
170
170
  - !ruby/object:Gem::Version
171
- version: '3.1'
171
+ version: '3.3'
172
172
  - - ">="
173
173
  - !ruby/object:Gem::Version
174
- version: 3.1.1
174
+ version: 3.3.1
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: graphlient
177
177
  requirement: !ruby/object:Gem::Requirement
@@ -244,12 +244,12 @@ files:
244
244
  - lib/ecoportal/api/graphql/base/location_classification_type.rb
245
245
  - lib/ecoportal/api/graphql/base/location_node.rb
246
246
  - lib/ecoportal/api/graphql/base/location_structure.rb
247
- - lib/ecoportal/api/graphql/base/model.rb
248
247
  - lib/ecoportal/api/graphql/base/organization.rb
249
248
  - lib/ecoportal/api/graphql/base/page.rb
250
249
  - lib/ecoportal/api/graphql/base/page_info.rb
251
250
  - lib/ecoportal/api/graphql/base/person_member.rb
252
251
  - lib/ecoportal/api/graphql/base/resource.rb
252
+ - lib/ecoportal/api/graphql/base_model.rb
253
253
  - lib/ecoportal/api/graphql/builder.rb
254
254
  - lib/ecoportal/api/graphql/builder/action.rb
255
255
  - lib/ecoportal/api/graphql/builder/contractor_entity.rb
@@ -294,6 +294,9 @@ files:
294
294
  - lib/ecoportal/api/graphql/input/search.rb
295
295
  - lib/ecoportal/api/graphql/input/search_filter.rb
296
296
  - lib/ecoportal/api/graphql/input/search_sorter.rb
297
+ - lib/ecoportal/api/graphql/interface.rb
298
+ - lib/ecoportal/api/graphql/interface/base_page.rb
299
+ - lib/ecoportal/api/graphql/interface/location_node.rb
297
300
  - lib/ecoportal/api/graphql/logic.rb
298
301
  - lib/ecoportal/api/graphql/logic/base_query.rb
299
302
  - lib/ecoportal/api/graphql/logic/connection.rb
@@ -1,13 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class GraphQL
4
- module Base
5
- class Model < Ecoportal::API::Common::GraphQL::Model
6
- class << self
7
- attr_accessor :client
8
- end
9
- end
10
- end
11
- end
12
- end
13
- end