Sha256: 33cf62fc4c6cfcabdb40ad92e90a20b9ad9440c08ea5e1aab5cb8be1240d8d37

Contents?: true

Size: 413 Bytes

Versions: 19

Compression:

Stored size: 413 Bytes

Contents

# frozen_string_literal: true

module Ibrain
  module Types
    class BaseApiConnection < Types::BaseObject
      # add `nodes` and `pageInfo` fields, as well as `edge_type(...)` and `node_nullable(...)` overrides
      include GraphQL::Types::Relay::ConnectionBehaviors

      field :total_count, Integer, null: false, camelize: false

      def total_count
        object.items.size
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ibrain-core-0.3.5 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.4 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.3.pre.rc.2 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.3.pre.rc.1 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.3 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.2.pre.rc.4 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.2.pre.rc.3 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.2.pre.rc app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.2 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.1 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.3.0 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.9 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.8 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.7 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.6 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.5 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.4 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.3 app/graphql/ibrain/types/base_api_connection.rb
ibrain-core-0.2.2 app/graphql/ibrain/types/base_api_connection.rb