Class: Resolvers::TimelogResolver

Inherits:
BaseResolver
  • Object
show all
Includes:
LooksAhead
Defined in:
app/graphql/resolvers/timelog_resolver.rb

Instance Method Summary collapse

Methods included from LooksAhead

#apply_lookahead, #resolve

Methods inherited from BaseResolver

as_single, authorization, authorized?, before_connection_authorization, before_connection_authorization_block, calls_gitaly!, complexity, complexity_multiplier, #current_user, field_options, last, #object, #offset_pagination, requires_argument!, resolver_complexity, #select_result, single, #single?, single_definition_blocks, singular_type, when_single

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#resolve_with_lookahead(**args) ⇒ Object


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/graphql/resolvers/timelog_resolver.rb', line 37

def resolve_with_lookahead(**args)
  validate_args!(object, args)

  timelogs = object&.timelogs || Timelog.limit(GitlabSchema.default_max_page_size)

  if args.any?
    args = parse_datetime_args(args)

    timelogs = apply_user_filter(timelogs, args)
    timelogs = apply_project_filter(timelogs, args)
    timelogs = apply_time_filter(timelogs, args)
    timelogs = apply_group_filter(timelogs, args)
  end

  apply_lookahead(timelogs)
end