Sha256: 445da093d90ce04deb445019a57bad2d211e12f737b7b1798431172a8a87ee2f

Contents?: true

Size: 971 Bytes

Versions: 51

Compression:

Stored size: 971 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Types
    module Relay
      module PageInfoBehaviors
        def self.included(child_class)
          child_class.extend ClassMethods
          child_class.description "Information about pagination in a connection."
          child_class.field :has_next_page, Boolean, null: false,
            description: "When paginating forwards, are there more items?"

          child_class.field :has_previous_page, Boolean, null: false,
            description: "When paginating backwards, are there more items?"

          child_class.field :start_cursor, String, null: true,
            description: "When paginating backwards, the cursor to continue."

          child_class.field :end_cursor, String, null: true,
            description: "When paginating forwards, the cursor to continue."
        end
      end

      module ClassMethods
        def default_relay?
          true
        end
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
graphql-2.1.2 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.1.1 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.1.0 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.27 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.26 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.25 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.24 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.23 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.22 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.21 lib/graphql/types/relay/page_info_behaviors.rb
graphql-2.0.20 lib/graphql/types/relay/page_info_behaviors.rb