Skip to content

N+1 queries when requesting access levels through graphql api

When there are protected ref access levels for groups and users and selecting accessLevelDescription in a graphql query, the humanize method (https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/graphql/types/branch_protections/base_access_level_type.rb#L17) can cause n+1 queries for groups and users.

This went undetected because we consistently test with selections that include group and user which would eager load groups and users.