-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prisma list of enums TS bug #1255
Comments
Thanks for the report, I'll try to get this fixed in the next day or so. In the mean time, this should also work: import { Environment,} from "@prisma/client"; // it is native enum
const EnvironmentEnum = builder.enumType(Environment, { name: "Environment" });
const EnvironmentVariableCreateInput = builder.prismaCreate("EnvironmentVariable", {
name: "EnvironmentVariableCreateInput",
fields: (t) => ({
key: t.string(),
value: t.string(),
isSensitive: t.boolean(),
environments: t.field({ type: [EnvironmentEnum] }),
}),
}); |
I tried to do the same, following the examples in the documentation. Exactly the same TS error :( Thanks, waiting for a fix, will put @ts-ignore up in the meantime |
I think I misunderstood the issue, it looks like it's expecting a single Environment rather than a list, I'll try to figure out what's going on with that |
The dilemma here is that I have tried all the ways to declare the list as a field where only enum values are expected. None of them allows to do it without an error, at the current stage. Thanks anyway |
I think the issue is in the Prisma utils plugin, I think it just doesn't handle array columns, but that shouldn't be too hard to fix |
should be fixed in the latest release |
Greetings, encountered a bug that does not affect operability but is a typing error.
The essence is as follows:
When trying to create a field that is an enum array, I get the following TS error:
At the same time, the performance is not affected in any way. Also below is the full code
The text was updated successfully, but these errors were encountered: