Sha256: 89a8b1955519eba60bb26ea5642180019ce90fc872e9e909b090fb4f3406509d

Contents?: true

Size: 517 Bytes

Versions: 9

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true

module Ibrain
  module Types
    class BaseObject < GraphQL::Schema::Object
      include GraphQL::Relay::Node

      edge_type_class(Ibrain::Types::BaseEdge)
      connection_type_class(Ibrain::Types::BaseConnection)

      field_class ::Ibrain::Types::BaseField

      field :name, String, null: true

      protected

      def loader
        Ibrain::Loaders::AssociationLoader
      end

      def current_user
        context.try(:fetch, :current_user)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ibrain-core-0.5.0 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.9 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.8 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.7 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.5 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.4 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.3 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.2 app/graphql/ibrain/types/base_object.rb
ibrain-core-0.4.1 app/graphql/ibrain/types/base_object.rb