An error occurs in the following configuration. Please tell me the cause of the error and how to fix it.
■Error message
Error: Cannot determine GraphQL input type for 'zzzzzInputs' of 'XxxxxInput' class. Is the value, that is used as its TS type or explicit type, decorated with a proper decorator or is it a proper input value?
■Reproduction environment and method
Clone
git clone https://github.com/isoittech/hellpj-type-graphqlExecute commands
npm ci
npm run start
■Application/library stack
- Node.js/Express
- sequelize
- sequelize-typescript
- type-graphql
■Source
https://github.com/isoittech/hellpj-type-graphql/blob/master/src/main/graphql/ppppp.resolver.ts
@ObjectType()
export class ZzzzzInput {
@Field((type) => ZzzzzType)
zzzzz!: ZzzzzType;
// @Field()
// zzzzz!: string;
}
@InputType()
export class XxxxxInput {
@Field((type) => [ZzzzzInput])
zzzzzInputs!: ZzzzzInput[];
// @Field((type) => [String])
// zzzzzInputs!: string[];
}
@Resolver((of) => Yyyyy)
export class XxxxxResolver {
@Mutation((returns) => Yyyyy)
async addXxxxx(@Arg("Xxxxx") XxxxxInput: XxxxxInput): Promise<Yyyyy> {
const serviceOutput: XxxxxServiceOutputDto = {};
return Promise.resolve(serviceOutput.addedXxxxx!);
}
}
■I coded it by referring to here.
https://typegraphql.com/docs/types-and-fields.html
Cannot determine GraphQL input type for argument named