[Question] rename field
Hi,
thnx for great work
I have one question: Is there any way to rename field inside gql type?
schema.prisma
model User { id: String @id
/// @Field({ name "another_name" }) field: String }
@generated/index.ts
@ObjectType({}) export class User { @Field(() => ID, { nullable:false }) id!: string;
@Field(() => String, { nullable:false, name: "another_name" })
field: string;
}
You want different name in graphql schema? You can expose custom name by using ResolveField https://docs.nestjs.com/graphql/resolvers
If you want different names in tables, see @@map Prisma schema API
https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#map-1
Actually, I want to change name in GQL schema by "name" option in "@Field" decorator @Field(() => String, { name: "antoher_name" })
@Field decorator is a part of nestjs/graphql module.