Sha256: c6df90658a5be3e621150167512ad65a6296694a4472b98045b3d0a627a758ae

Contents?: true

Size: 635 Bytes

Versions: 170

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true
require "graphql/pagination/relation_connection"

module GraphQL
  module Pagination
    # Customizes `RelationConnection` to work with `Sequel::Dataset`s.
    class SequelDatasetConnection < Pagination::RelationConnection
      private

      def relation_offset(relation)
        relation.opts[:offset]
      end

      def relation_limit(relation)
        relation.opts[:limit]
      end

      def relation_count(relation)
        # Remove order to make it faster
        relation.order(nil).count
      end

      def null_relation(relation)
        relation.where(false)
      end
    end
  end
end

Version data entries

170 entries across 170 versions & 2 rubygems

Version Path
graphql-2.4.8 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.7 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.6 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.5 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.4 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.3 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.2 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.1 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.4.0 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.20 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.19 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.18 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.17 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.16 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.15 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.14 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.13 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.12 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.11 lib/graphql/pagination/sequel_dataset_connection.rb
graphql-2.3.10 lib/graphql/pagination/sequel_dataset_connection.rb