8000 Extensions middleware to be able to hook into input validation · Issue #1687 · async-graphql/async-graphql · GitHub
[go: up one dir, main page]

Skip to content
Extensions middleware to be able to hook into input validation #1687
@urmaul

Description

@urmaul

Description of the feature

I'm trying to add error extensions to input validation errors and it seems like there's no way to do that now. I tried to make an extension with a validation hook but it looks like validation runs before the input validation and there is no hook for input validation. Can you add one?

Code example (if possible)

#[async_trait::async_trait]
pub trait Extension: Sync + Send + 'static {
    // ...

    async fn input_validation(
        &self,
        ctx: &ExtensionContext<'_>,
        next: NextValidation<'_>,
    ) -> Result<_, Vec<InputValueError>> {
        next.run(ctx).await
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0