{"record":{"id":"63915ad3cab64f4b","repo":"theforeman/foreman","slug":"could-not-resolve-id","errorCode":null,"errorMessage":"Could not resolve ID.","messagePattern":"Could not resolve ID\\.","errorType":"validation","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/base_mutation.rb","lineNumber":53,"sourceCode":"\n      return if action == :create && authorizer.can?(permission_name)\n      return if action != :create && authorizer.can?(permission_name, resource)\n\n      raise GraphQL::ExecutionError.new(\n        _('Unauthorized. You do not have the required permission %s.') % permission_name\n      )\n    end\n\n    def validate_object(resource)\n      unless resource.is_a?(resource_class)\n        raise GraphQL::ExecutionError.new(\"Resource mismatch, expected #{resource_class.name}, got #{resource.class.name}\")\n      end\n    end\n\n    def load_object_by(id:)\n      object = GraphQL::Batch.batch { ForemanGraphqlSchema.object_from_id(id, context) }\n\n      raise GraphQL::ExecutionError.new(_('Could not resolve ID.')) unless object\n\n      validate_object(object)\n\n      object\n    end\n\n    def save_object(resource)\n      User.as(context[:current_user]) do\n        errors = if resource.save\n                   []\n                 else\n                   resource.restore_attributes if resource.persisted?\n                   map_errors_to_path(resource)\n                 end\n\n        {\n          result_key => resource,\n          :errors => errors,","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/graphql/mutations/base_mutation.rb#L35-L71","documentation":"Error \"Could not resolve ID.\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/graphql/mutations/base_mutation.rb:53 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":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}