Commit 492a658b authored by Igor Drozdov's avatar Igor Drozdov

Merge branch '211607-offset-pagination' into 'master'

GraphQL: Refactor OffsetActiveRecordRelationConnection to use new GraphQL::Pagination class

See merge request gitlab-org/gitlab!27459
parents f81f30c2 477021bf
......@@ -16,10 +16,6 @@ module Gitlab
Gitlab::Graphql::ExternallyPaginatedArray,
Gitlab::Graphql::Connections::ExternallyPaginatedArrayConnection
)
GraphQL::Relay::BaseConnection.register_connection_implementation(
Gitlab::Graphql::Pagination::Relations::OffsetActiveRecordRelation,
Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection
)
end
end
end
......
......@@ -6,7 +6,7 @@
module Gitlab
module Graphql
module Pagination
class OffsetActiveRecordRelationConnection < GraphQL::Relay::RelationConnection
class OffsetActiveRecordRelationConnection < GraphQL::Pagination::ActiveRecordRelationConnection
end
end
end
......
# frozen_string_literal: true
module Gitlab
module Graphql
module Pagination
module Relations
class OffsetActiveRecordRelation < ::ActiveRecord::Relation
end
end
end
end
end
......@@ -52,12 +52,6 @@ describe GitlabSchema do
expect(connection).to eq(Gitlab::Graphql::Connections::FilterableArrayConnection)
end
it 'paginates OffsetActiveRecordRelation using `Pagination::OffsetActiveRecordRelationConnection`' do
connection = implementations[Gitlab::Graphql::Pagination::Relations::OffsetActiveRecordRelation.name]
expect(connection).to eq(Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection)
end
describe '.execute' do
context 'for different types of users' do
context 'when no context' do
......
......@@ -4,6 +4,6 @@ require 'spec_helper'
describe Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection do
it 'subclasses from GraphQL::Relay::RelationConnection' do
expect(described_class.superclass).to eq GraphQL::Relay::RelationConnection
expect(described_class.superclass).to eq GraphQL::Pagination::ActiveRecordRelationConnection
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment