Sha256: 18309d12e92c218ef579eef3a6f6c062ae0452fc029d5ddd8649e106dd919245

Contents?: true

Size: 654 Bytes

Versions: 2

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

module Osso
  module GraphQL
    module Mutations
      class BaseMutation < ::GraphQL::Schema::RelayClassicMutation
        # This is used for generating payload types
        object_class Types::BaseObject
        # # This is used for return fields on the mutation's payload
        # field_class Types::BaseField
        # # This is used for generating the `input: { ... }` object type
        # input_object_class Types::BaseInputObject

        def return_data(data)
          data.merge(errors: [])
        end

        def return_error(error)
          error.merge(data: nil)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
osso-0.0.3.5 lib/osso/graphql/mutations/base_mutation.rb
osso-0.0.3.4 lib/osso/graphql/mutations/base_mutation.rb