Allow GraphQL fields to have feature_category metadata

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

About

This issue is part of the epic &11407. See that epic description for more context.

This issue is to allow us to attribute feature_category metadata to GraphQL fields. This will allow people to determine which group owns the fields. It can lead to Log the field performance of GraphQL queries in... (#424537) and Feed GraphQL feature_category field data into E... (#424540).

Proposal

We want to allow GraphQL fields to be given feature_category metadata. !119412 has a small example of this.

Field feature_category would be found for each field by (stopping when one was found):

  1. Any definition on field
  2. If field uses a resolver, any definition on the resolver
  3. Any definition on the field's owner type

For example:

class ExampleResolver < BaseResolver
  feature_category :on_resolver
end

class ExampleType < BaseObject
  feature_category :on_type

  field :foo # has `:on_type` (inherited from Type)
  field :bar, feature_category: :on_field # has `:on_field`
  field :baz, resolver: ExampleResolver # has `:on_resolver` (inherited from its resolver)
  field :qux, resolver: ExampleResolver, feature_category: :on_field # has `:on_field`
end
Edited by 🤖 GitLab Bot 🤖