hasura/graphql-engine · error · TypeOutputPermissionError

multiple output type permissions have been defined for type:

Error message

multiple output type permissions have been defined for type: {type_name:}

What it means

The metadata resolver found two or more output type permission definitions for the same object type. OpenDD output permissions are a single logical document per type, so duplicates are ambiguous and rejected.

Source

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

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> {
        None
    }
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Search the metadata sources for all definitions of outputTypePermissions referencing the offending typeName
  2. Delete or rename the duplicate so exactly one output permission definition exists per type
  3. If different roles need different rules, combine them into one definition using multiple filter sets / roles rather than duplicating the document

Example fix

# before
# doc1.yaml
typeName: { name: User }
outputTypePermissions: { ... }
# doc2.yaml (duplicate)
typeName: { name: User }
outputTypePermissions: { ... }

# after
# keep only doc1.yaml; delete doc2.yaml or merge its rules into doc1.yaml
Defensive patterns

Strategy: validation

Validate before calling

// collect outputTypePermissions by typeName and assert uniqueness
let mut seen = HashSet::new();
for d in docs.output_permission_docs() {
    if !seen.insert(d.type_name.clone()) {
        return Err(format!("duplicate output permissions for {}", d.type_name));
    }
}

Prevention

When it happens

Trigger: Having two OpenDD documents (or two entries within one document) both defining outputTypePermissions for the same qualified typeName in the same subgraph.

Common situations: Copy-pasting a permission document and forgetting to change typeName, merging branches that each added a permission for the same type, or iterating on permissions in a separate file that duplicates an existing one.

Related errors


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