Map-like property type #849
-
@InputType()
class Thing {
// other properties ...
/* Unable to infer GraphQL type from TypeScript reflection system. You need to provide explicit type for 'mapLike' of 'Thing' class */
@Field({ nullable: true })
mapLike: Record<number, string[]> | null;
}
@Resolver(/* whatever */)
class CoolResolver {
// other methods ...
@Mutation(() => Thing)
async update(@Arg('thing') thing: Thing): Promise<Thing> {
// ...
return thing;
}
} How would I go about giving the I would also like to keep another property identical to this "mapLike" one but on a property of a @ObjectType()
class Thing2 {
// other properties ...
/* The previous error appears here as well */
@Field()
mapLike: Record<number, string[]>
} |
Beta Was this translation helpful? Give feedback.
Answered by
MichalLytek
Apr 6, 2021
Replies: 1 comment 1 reply
-
Duplicate of #845 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
almeidx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Duplicate of #845