{"record":{"id":"e1394e401064fbee","repo":"hasura/graphql-engine","slug":"unsupported-type-in-output-type-permissions-defini","errorCode":null,"errorMessage":"unsupported type in output type permissions definition: {type_name:}; only object types are supported","messagePattern":"unsupported type in output type permissions definition: (.+?); only object types are supported","errorType":"validation","errorClass":"TypeOutputPermissionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/type_permissions/error.rs","lineNumber":9,"sourceCode":"use crate::helpers::typecheck::{self, TypecheckIssue};\nuse crate::types::error::{ContextualError, Error, ShouldBeAnError};\nuse open_dds::types::{CustomTypeName, FieldName};\n\nuse crate::types::subgraph::Qualified;\n\n#[derive(Debug, thiserror::Error)]\npub enum TypeOutputPermissionError {\n    #[error(\n        \"unsupported type in output type permissions definition: {type_name:}; only object types are supported\"\n    )]\n    UnsupportedTypeInOutputPermissions { type_name: CustomTypeName },\n    #[error(\"multiple output type permissions have been defined for type: {type_name:}\")]\n    DuplicateOutputTypePermissions { type_name: CustomTypeName },\n    #[error(\"unknown type used in output permissions: {type_name:}\")]\n    UnknownTypeInOutputPermissionsDefinition {\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\"unknown field '{field_name:}' used in output permissions of type '{type_name:}'\")]\n    UnknownFieldInOutputPermissionsDefinition {\n        field_name: FieldName,\n        type_name: Qualified<CustomTypeName>,\n    },\n}\n\nimpl ContextualError for TypeOutputPermissionError {\n    fn create_error_context(&self) -> Option<error_context::Context> {","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/type_permissions/error.rs#L1-L27","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check the type referenced in the outputTypePermissions block and confirm it is declared as an object type (kind: ObjectType) in the same metadata subgraph","Move or remove the permission definition so it only targets object types","Re-run metadata resolution (cargo build / CLI metadata resolve) to confirm the error clears"],"exampleFix":"# before\ntypeName:\n  name: Status   # 'Status' is an enum type\noutputTypePermissions: ...\n\n# after\n# remove the permission from the enum, or target the object type:\ntypeName:\n  name: User    # 'User' is an object type\noutputTypePermissions: ...","handlingStrategy":"validation","validationCode":"// before resolving, check the target type's kind in your metadata sources\nfn isObjectType(kind: &str) -> bool { kind == \"ObjectType\" }\n// assert isObjectType(doc.typePermissions.type.kind) before submitting metadata","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint OpenDD documents so typePermissions only target types with kind: ObjectType","Keep permissions in files adjacent to the types they reference"],"tags":["opendd","metadata","permissions","type-validation"],"backgroundTag":"metadata-validation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}