#graphql @Args with pipe: how to convert to @ArgsType @Field?

3 messages · Page 1 of 1 (latest)

obtuse nest
#

When converting a method with an argument like @Args("x", { type: () => [T] }, TPipe) a: T to use @ArgsType, where does the pipe go?

@argsType()
class MArgs {
  @Field((type) => Int)
  // @WithPipe(TPipe) ?
  x: T
}

Thanks!

somber tangle
#

@obtuse nest - Use @UsePipes(new MyValidationPipe) to decorate the resolver method, if you wish to make your own custom validation pipe. If you want the standard Nest validation pipe, you could make it global. Depends on what you need.

obtuse nest
#

Is it possible to use a pipe only for the entire graphql module and not globally?