Class: Gitlab::Graphql::Pagination::Keyset::Conditions::NotNullCondition

Inherits:
BaseCondition
  • Object
show all
Defined in:
lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition.rb

Instance Method Summary collapse

Methods inherited from BaseCondition

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Graphql::Pagination::Keyset::Conditions::BaseCondition

Instance Method Details

#buildObject


9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition.rb', line 9

def build
  conditions = [first_attribute_condition]

  # If there is only one order field, we can assume it
  # does not contain NULLs, and don't need additional
  # conditions
  unless order_list.count == 1
    conditions << [second_attribute_condition, final_condition]
  end

  conditions.join
end