Skip to content

@Field() midleware not running on @ArgsType() or @InputType() #2446

@dragosmc

Description

@dragosmc

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The behaviour described in the documentation under Field middleware indicates that the middlewares are driven by the @Field() decorator, but I found that they don't work for all types.

In other words, the middlewares only get called on ObectType() but not on @ArgsType() or @InputType().

The code snippets are take from the main branch of this repo and the middleware is the one described in the documentation here https://docs.nestjs.com/graphql/field-middleware

Minimum reproduction code

https://gist.github.com/dragosmc/1e59619831f78be9b3420f6e7affd928

Steps to reproduce

No response

Expected behavior

The output to contain the output of all 3 for running the e2e tests that were modified with the middlewares in the gist.

 yarn test:e2e 

Package version

10.1.3

Graphql version

No response

NestJS version

10.1.3

Node.js version

16.15.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions