Sha256: df5dfe3ae208fddad10203b5bf98f5342978d291f04d9a7a4f6096ca7d306206

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
osso-0.0.3.2 lib/osso/graphql/mutations/base_mutation.rb
osso-0.0.3.1 lib/osso/graphql/mutations/base_mutation.rb