prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
generate inputs args ... with comments
generated models are with comments is there any way to generate inputs args ... with comments?
How are seeing this? Could you provide an example?
user.model.ts have descriptions
but user-where.input.ts user-create.input.ts ... don't have descriptions
these descriptions are useful. we can use these descriptions generate column title in frontend project.
Ok, got it. But meaning of this field in *whereinput class is different. This is like search condition, not the value.
If you are introspecting schema, why you cant take this description from models?
i want generate search form from user-where.input.ts . keep zhe same schema.
request variables require this structure
i will generate form that submit zhe same structure data. i am dealing this useing formily
By the way , thank you for this amazing tool !
I can suggest generate comments for inputs by following way: It will be configuration setting
inputFieldDescription = "Filter {model.name} for {fied.name}"
It may generate class like:
@InputType()
export class UserWhereInput {
@Field(() => StringFilter, { nullable: true, description: "Filter User by name" })
name?: StringFilter;
}
It will possible to add more tokens: model name in plural, etc.
I can suggest generate comments for inputs by following way: It will be configuration setting
inputFieldDescription = "Filter {model.name} for {fied.name}"
It may generate class like:
@InputType() export class UserWhereInput { @Field(() => StringFilter, { nullable: true, description: "Filter User by name" }) name?: StringFilter; }
It will possible to add more tokens: model name in plural, etc.
I think it will not work, we have different kinds of inputs: create, update, where, where unique, etc. single comment pattern is not suitable for them.