summaryrefslogtreecommitdiff
path: root/lib/gitlab/graphql/present.rb
blob: 2c7b64f1be92a8d15ebaff76e2f43e1e11901a53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Gitlab
  module Graphql
    module Present
      extend ActiveSupport::Concern
      prepended do
        def self.present_using(kls)
          @presenter_class = kls
        end

        def self.presenter_class
          @presenter_class
        end
      end

      def self.use(schema_definition)
        schema_definition.instrument(:field, Instrumentation.new)
      end
    end
  end
end