Comments (6)
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] }),
}),
});
from pothos.
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
from pothos.
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
from pothos.
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
from pothos.
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
from pothos.
should be fixed in the latest release
from pothos.
Related Issues (20)
- [Prisma plugin] Required field should be non-nullable automatically unless we override it HOT 2
- v4 generates empty Prisma types HOT 1
- DataLoader missing fields using v4 HOT 3
- [Simple Objects Plugin] Simple Interfaces fail to implement other interfaces HOT 4
- Typescript version 4 errors when running pothos v4.0 HOT 2
- Sentry tracing plugin no longer obeys ignoreError option HOT 3
- Typescript Error on type Field When Using after with `withAuth` HOT 1
- After V4 update ts(2322) on InputObjectRef type HOT 1
- Adding fields to @pothos/plugin-relay's `Node` interface HOT 2
- Default nullability in printed schemas is true HOT 6
- Prisma Utils plugin does not have createMany option HOT 2
- Build inputs with auth HOT 2
- Latest plugin-prisma-utils not published on NPM HOT 3
- [Question] Extract query creation to generic method
- [BUG] Cannot accept/send array using input type / input plugin HOT 4
- [BUG Replay plugin] PothosValidationError: Invalid global ID: RXN0YXRlOjRlYTk5YmYxLTA3MTktNDNkZi04ZTZkLWM4MjA1YjE5MGNhZQ%3D%3D HOT 3
- Merging schema results in infinite loop in v4. (RangeError: Maximum call stack size exceeded at mergeDeep (/Users/*/node_modules/@graphql-tools/utils/cjs/mergeDeep.js:5:19))
- Nullable typescript issue on prisma plugin HOT 8
- Define additional fields for prisma connection object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pothos.