2019-06-21 10:20:00 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Graphql
|
2019-07-02 01:32:44 -04:00
|
|
|
# Wraps the field resolution to count Gitaly calls before and after.
|
|
|
|
# Raises an error if the field calls Gitaly but hadn't declared such.
|
2019-06-21 10:20:00 -04:00
|
|
|
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
|