#Mutation input

3 messages · Page 1 of 1 (latest)

crisp kraken
#

Hello everyone. Im learning Nestjs and I came across to this example in the documentation:

@Mutation(returns => Post)
async upvotePost(
  @Args('upvotePostData') upvotePostData: UpvotePostInput,
) {}

Why do I need to add an argument of 'upvotePostData' to the parameter decorator? Is the name arbitrary?

idle inlet
#

@crisp kraken - The name of the argument can be any name. It's just best practice to use the same name as the input object.

elder fractal