{"record":{"id":"76ccc450a7d129b5","repo":"gitlabhq/gitlabhq","slug":"global-id-is-not-a-valid-gitlab-id","errorCode":null,"errorMessage":"#{global_id} is not a valid GitLab ID.","messagePattern":"#(.+?) is not a valid GitLab ID\\.","errorType":"exception","errorClass":"Gitlab::Graphql::Errors::ArgumentError","httpStatus":null,"severity":"error","filePath":"app/graphql/gitlab_schema.rb","lineNumber":145,"sourceCode":"    #  * it may not match the expected type (see below)\n    #\n    # Options:\n    #  * :expected_type [Class] - the type of object this GlobalID should refer to.\n    #  * :expected_type [[Class]] - array of the types of object this GlobalID should refer to.\n    #\n    # e.g.\n    #\n    # ```\n    #   gid = GitlabSchema.parse_gid(my_string, expected_type: ::Project)\n    #   project_id = gid.model_id\n    #   gid.model_class == ::Project\n    # ```\n    def parse_gid(global_id, ctx = {})\n      expected_types = Array(ctx[:expected_type])\n      gid = GlobalID.parse(global_id)\n\n      unless gid\n        raise Gitlab::Graphql::Errors::ArgumentError,\n          \"#{global_id} is not a valid GitLab ID.\"\n      end\n\n      if expected_types.any? && expected_types.none? do |type|\n        gid.model_class.ancestors.include?(type)\n      end\n        vars = { global_id: global_id, expected_types: expected_types.join(', ') }\n        msg = _('%{global_id} is not a valid ID for %{expected_types}.') % vars\n        raise Gitlab::Graphql::Errors::ArgumentError, msg\n      end\n\n      gid\n    end\n\n    # Parse an array of strings to an array of GlobalIDs, raising ArgumentError if there are problems\n    # with it.\n    # See #parse_gid\n    #","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/gitlabhq/gitlabhq/blob/55ee20384a1f55cb0e362dee1d07149613b1b9bf/app/graphql/gitlab_schema.rb#L127-L163","documentation":"Error \"#{global_id} is not a valid GitLab ID.\" thrown in gitlabhq/gitlabhq.","triggerScenarios":"Thrown at app/graphql/gitlab_schema.rb:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55ee20384a1f55cb0e362dee1d07149613b1b9bf","analyzedAt":"2026-08-21T14:22:27.782Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}