hasura/graphql-engine · error · TypeOutputPermissionError

unsupported type in output type permissions definition

Error message

unsupported type in output type permissions definition: {type_name:}; only object types are supported

What it means

Thrown by the metadata-resolve stage for type permissions when an OpenDD TypeOutputPermission is attached to a type that is not an object type. Only object types can carry output type permissions because row-level permissions (filter sets, field selection) are only meaningful on objects with fields.

Solutions

  1. Check the type referenced in the outputTypePermissions block and confirm it is declared as an object type (kind: ObjectType) in the same metadata subgraph
  2. Move or remove the permission definition so it only targets object types
  3. Re-run metadata resolution (cargo build / CLI metadata resolve) to confirm the error clears

Example fix

# before
typeName:
  name: Status   # 'Status' is an enum type
outputTypePermissions: ...

# after
# remove the permission from the enum, or target the object type:
typeName:
  name: User    # 'User' is an object type
outputTypePermissions: ...
Defensive patterns

Strategy: validation

Validate before calling

// before resolving, check the target type's kind in your metadata sources
fn isObjectType(kind: &str) -> bool { kind == "ObjectType" }
// assert isObjectType(doc.typePermissions.type.kind) before submitting metadata

Prevention

When it happens

Trigger: Defining an `outputTypePermissions` block in an OpenDD TypePermission document whose `typeName` resolves to a non-object type (e.g. an enum or a scalar defined elsewhere in the metadata).

Common situations: Authoring OpenDD YAML permission documents against a subtype accidentally, copy-pasting a permission block from an object type onto an enum, or renaming a type so the permission now points at a non-object definition.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/e1394e401064fbee. Report an issue: GitHub.

Appendix: source

Thrown at v3/crates/metadata-resolve/src/stages/type_permissions/error.rs:9

use crate::helpers::typecheck::{self, TypecheckIssue};
use crate::types::error::{ContextualError, Error, ShouldBeAnError};
use open_dds::types::{CustomTypeName, FieldName};

use crate::types::subgraph::Qualified;

#[derive(Debug, thiserror::Error)]
pub enum TypeOutputPermissionError {
    #[error(
        "unsupported type in output type permissions definition: {type_name:}; only object types are supported"
    )]
    UnsupportedTypeInOutputPermissions { type_name: CustomTypeName },
    #[error("multiple output type permissions have been defined for type: {type_name:}")]
    DuplicateOutputTypePermissions { type_name: CustomTypeName },
    #[error("unknown type used in output permissions: {type_name:}")]
    UnknownTypeInOutputPermissionsDefinition {
        type_name: Qualified<CustomTypeName>,
    },
    #[error("unknown field '{field_name:}' used in output permissions of type '{type_name:}'")]
    UnknownFieldInOutputPermissionsDefinition {
        field_name: FieldName,
        type_name: Qualified<CustomTypeName>,
    },
}

impl ContextualError for TypeOutputPermissionError {
    fn create_error_context(&self) -> Option<error_context::Context> {

View on GitHub (pinned to 724551b9ae)