-
-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Arg with array of inputs #314
Comments
|
Thanks, that was fast! Was it in documentation and I simply couldn't find it or it wasn't here? |
Im trying to replicate the same thing but however i'm not winning |
for me it is also not working. @Args('postCreateInputList', type => [PostCreateInput]) Argument of type '(type: any) => (typeof PostCreateInput)[]' is not assignable to parameter of type 'PipeTransform<any, any> | Type<PipeTransform<any, any>>'. Kind regards, Gerry |
@innoveltec Because you use NestJS and it has a different syntax - |
ok it's working fine now. Great job! |
What is the difference between @Args() and @arg()? I have seen many examples with the latter, but I am using NestJS and only the plural seems to work. I'm looking for the syntax @innoveltec wound up with, considering @MichalLytek provided curly braces. My example is this:
Where HouseAddyCreate is an intersection type of two @inputType() classes, like: |
However, NestJS uses only
Types doesn't exist on runtime - you need to create an |
Thanks for the added info, Michal! I did try your suggestion which was to create a new InputType and I added the second type as a field. This works! However, can you advise how I might remove duplicate fields, since it is not quite an intersection.
|
@theRocket See #453 😉 |
Got it, thanks! I was just looking at Omit: https://www.typescriptlang.org/docs/handbook/utility-types.html#omittk |
Hi there! I had a problem with @arg.
I wanted to use @arg with array of input objects, but get error like this:
You need to provide explicit type for GetOrderResolver#addOrder parameter #1
Is there a way to do something like this?
@arg('items') items: ItemInput[] (I know syntax like this wouldn't work)
The text was updated successfully, but these errors were encountered: