Sha256: f2313d122b4e1ab860ee629f94f24c1efee9a5b15fd581a011600623cbc5bd8c

Contents?: true

Size: 802 Bytes

Versions: 8

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

module Ibrain
  module Mutations
    class BaseMutation < GraphQL::Schema::RelayClassicMutation
      argument_class Types::BaseArgument
      field_class Types::BaseField
      input_object_class Types::BaseInputObject
      object_class Types::BaseObject

      argument :attribute, Types::AttributeType, required: false
      argument :attributes, [Types::AttributeType], required: false

      def resolve(args)
        @params = ::ActionController::Parameters.new(args)
      end

      protected

      attr_reader :params

      def upload_permitted
        %i[content_type headers original_filename tempfile]
      end

      def cryptor
        ::Ibrain::Encryptor.new
      end

      def current_user
        context[:current_user]
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ibrain-core-0.1.7 app/graphql/ibrain/mutations/base_mutation.rb
ibrain-core-0.1.6 app/graphql/ibrain/mutations/base_mutation.rb
ibrain-core-0.1.5 app/graphql/ibrain/mutations/base_mutation.rb
ibrain-core-0.1.4 app/graphql/ibrain/mutations/base_mutation.rb
ibrain-core-0.1.3 app/graphql/ibrain/mutations/base_mutation.rb
ibrain-core-0.1.2 app/graphql/ibrain/mutations/base_mutation.rb
ibrain-core-0.1.1 app/graphql/ibrain/mutations/base_mutation.rb
ibrain-core-0.1.0 app/graphql/ibrain/mutations/base_mutation.rb