gitlab-org--gitlab-foss/lib/gitlab/graphql/calls_gitaly.rb
charlieablett 675c9b9f6b Address reviewer comments
- Remove Gitaly call check for fields that have a constant complexity
declared
- Add associated test
2019-07-05 10:18:50 +12:00

15 lines
454 B
Ruby

# frozen_string_literal: true
module Gitlab
module Graphql
# Wraps the field resolution to count Gitaly calls before and after.
# Raises an error if the field calls Gitaly but hadn't declared such.
module CallsGitaly
extend ActiveSupport::Concern
def self.use(schema_definition)
schema_definition.instrument(:field, Gitlab::Graphql::CallsGitaly::Instrumentation.new, after_built_ins: true)
end
end
end
end