diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /app/graphql/gitlab_schema.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'app/graphql/gitlab_schema.rb')
-rw-r--r-- | app/graphql/gitlab_schema.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/graphql/gitlab_schema.rb b/app/graphql/gitlab_schema.rb index c0e063a34d5..37adf4c2d3b 100644 --- a/app/graphql/gitlab_schema.rb +++ b/app/graphql/gitlab_schema.rb @@ -137,6 +137,19 @@ class GitlabSchema < GraphQL::Schema gid end + # Parse an array of strings to an array of GlobalIDs, raising ArgumentError if there are problems + # with it. + # See #parse_gid + # + # ``` + # gids = GitlabSchema.parse_gids(my_array_of_strings, expected_type: ::Project) + # project_ids = gids.map(&:model_id) + # gids.all? { |gid| gid.model_class == ::Project } + # ``` + def parse_gids(global_ids, ctx = {}) + global_ids.map { |gid| parse_gid(gid, ctx) } + end + private def max_query_complexity(ctx) |