Sha256: 954ce4769bd9944ea3d6218f5920b7799bbe6d19ec14b2d374594476e705d6cd

Contents?: true

Size: 731 Bytes

Versions: 14

Compression:

Stored size: 731 Bytes

Contents

module Ecoportal
  module API
    class GraphQL
      module Logic
        class Payload < Ecoportal::API::GraphQL::Base::Model
          class GenericItem
            def initialize(*args, **kargs)
              raise "Missuse error. You should define a item_class for a class that inherits from GraphqlPayload class."
            end
          end

          passthrough :clientMutationId

          class_resolver :item_class, GenericItem
          embeds_one :item, klass: :item_class
          embeds_one :errors, klass: Ecoportal::API::GraphQL::Error::ValidationErrors, nullable: true

          def success?
            !errors || errors.empty?
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ecoportal-api-graphql-0.3.13 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.12 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.11 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.10 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.9 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.8 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.7 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.6 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.5 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.3 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.3.1 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.2.3 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.2.2 lib/ecoportal/api/graphql/logic/payload.rb
ecoportal-api-graphql-0.2.1 lib/ecoportal/api/graphql/logic/payload.rb