Open shawnjones253 opened 11 months ago
You need this field in inputs in order to properly find unique records in db via graphql api.
You need this field in inputs in order to properly find unique records in db via graphql api.
sorry, my example should have marked the id
as @unique
as well
in my case, i want to expose id
as the only unique the caller is allowed to use for input, despite prisma allowing id
| id_organizationId
to make this more clear, i can hide regular @unique
s but not @@unique
s -- as long as i leave at least one of the regular @unique
s available to the caller that should still work with findUnique
right?
@MichalLytek -- here's a clearer example:
model MyModel {
id String @unique
/// @TypeGraphQL.omit(output: true, input: true)
organizationId String
@@unique([id, organizationId])
}
this currently generates:
export declare class MyModelWhereUniqueInput {
id?: string | undefined;
id_organizationId?: MyModelIdOrganizationIdCompoundUniqueInput | undefined;
}
but what i want to generate instead is:
export declare class MyModelWhereUniqueInput {
id?: string | undefined;
}
that still has at least one unique field (id
) so it would still be usable as input to findUnique
for context, organizationId
should be opaque to end users in my application, i'd like to use it in a prisma context without exposing it via the api / typegraphql types
@MichalLytek see clarification above
Is your feature request related to a problem? Please describe. assume you have this model:
there doesn't seem to be a way to hide the generated
id_organizationId
field in typegraphql-generated types (if there is please let me know) :)Describe the solution you'd like The clearest way I can think of is to make
/// @TypeGraphQL.omit(input: true)
work for@@unique
Describe alternatives you've considered ???