theforeman/foreman · error · GraphQL::ExecutionError

Could not resolve ID.

Error message

Could not resolve ID.

What it means

Error "Could not resolve ID." thrown in theforeman/foreman.

Source

Thrown at app/graphql/mutations/base_mutation.rb:53

      return if action == :create && authorizer.can?(permission_name)
      return if action != :create && authorizer.can?(permission_name, resource)

      raise GraphQL::ExecutionError.new(
        _('Unauthorized. You do not have the required permission %s.') % permission_name
      )
    end

    def validate_object(resource)
      unless resource.is_a?(resource_class)
        raise GraphQL::ExecutionError.new("Resource mismatch, expected #{resource_class.name}, got #{resource.class.name}")
      end
    end

    def load_object_by(id:)
      object = GraphQL::Batch.batch { ForemanGraphqlSchema.object_from_id(id, context) }

      raise GraphQL::ExecutionError.new(_('Could not resolve ID.')) unless object

      validate_object(object)

      object
    end

    def save_object(resource)
      User.as(context[:current_user]) do
        errors = if resource.save
                   []
                 else
                   resource.restore_attributes if resource.persisted?
                   map_errors_to_path(resource)
                 end

        {
          result_key => resource,
          :errors => errors,

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/graphql/mutations/base_mutation.rb:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23). Data as JSON: /api/errors/63915ad3cab64f4b. Report an issue: GitHub.