Sha256: 41c10d75febbd4c7004bb5ee9528ccd2582267661295fad8e8574acea0344f92

Contents?: true

Size: 412 Bytes

Versions: 50

Compression:

Stored size: 412 Bytes

Contents

module Souls
  class SoulsConnection < GraphQL::Types::Relay::BaseConnection
    field :total_count, Integer, null: false do
      description "Total number of items"
    end
    field :total_pages, Integer, null: false do
      description "Total number of pages"
    end

    def total_count
      object.items.size
    end

    def total_pages
      (total_count / object.max_page_size) + 1
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
souls-1.17.3 lib/souls/app/graphql/souls_connection.rb
souls-1.17.2 lib/souls/app/graphql/souls_connection.rb
souls-1.17.1 lib/souls/app/graphql/souls_connection.rb
souls-1.17.0 lib/souls/app/graphql/souls_connection.rb
souls-1.16.4 lib/souls/app/graphql/souls_connection.rb
souls-1.16.3 lib/souls/app/graphql/souls_connection.rb
souls-1.16.2 lib/souls/app/graphql/souls_connection.rb
souls-1.16.1 lib/souls/app/graphql/souls_connection.rb
souls-1.16.0 lib/souls/app/graphql/souls_connection.rb
souls-1.15.5 lib/souls/app/graphql/souls_connection.rb
souls-1.15.4 lib/souls/app/graphql/souls_connection.rb
souls-1.15.3 lib/souls/app/graphql/souls_connection.rb
souls-1.15.2 lib/souls/app/graphql/souls_connection.rb
souls-1.15.1 lib/souls/app/graphql/souls_connection.rb
souls-1.15.0 lib/souls/app/graphql/souls_connection.rb
souls-1.14.3 lib/souls/app/graphql/souls_connection.rb
souls-1.14.2 lib/souls/app/graphql/souls_connection.rb
souls-1.14.1 lib/souls/app/graphql/souls_connection.rb
souls-1.14.0 lib/souls/app/graphql/souls_connection.rb
souls-1.13.8 lib/souls/app/graphql/souls_connection.rb