Comments (8)
That doesn't seem expected, can you share more about your setup (eg what options/types are passed to your builder) or a reproduction? I don't see anything wrong with your setup, but I also haven't seen this in any of the other APIs I've worked on, so there is probably some combination of settings or something that is off
from pothos.
yeah for sure.
it only happens in VS code, when I run my pnpm type-check
no ts errors there.
// builder.ts
import SchemaBuilder from '@pothos/core';
import WithInputPlugin from '@pothos/plugin-with-input';
import { DateTimeResolver, JSONResolver } from 'graphql-scalars';
import PrismaPlugin from '@pothos/plugin-prisma';
import PrismaUtilsPlugin from '@pothos/plugin-prisma-utils';
import RelayPlugin from '@pothos/plugin-relay';
import ScopeAuthPlugin from '@pothos/plugin-scope-auth';
import TracingPlugin, { isRootField } from '@pothos/plugin-tracing';
import ValidationPlugin from '@pothos/plugin-validation';
import { createSentryWrapper } from '@pothos/tracing-sentry';
import { Prisma } from '@prisma/client';
import { GraphqlContext } from '../pothos/context';
import type PrismaTypes from '../prisma/pothos-types';
import db from '../services/prisma';
const traceResolver = createSentryWrapper({
includeArgs: true,
includeSource: true,
});
const builder = new SchemaBuilder<{
AuthScopes: {
...
};
Context: GraphqlContext;
Objects: {
...
};
PrismaTypes: PrismaTypes;
Scalars: {
ID: {
Output: number | string;
Input: string;
};
DateTime: {
Output: Date;
Input: Date;
};
JSONObject: {
Input: any;
Output: any;
};
};
Tracing: boolean | { formatMessage: (duration: number) => string };
}>({
plugins: [
TracingPlugin,
WithInputPlugin,
RelayPlugin,
ScopeAuthPlugin,
PrismaPlugin,
PrismaUtilsPlugin,
ValidationPlugin,
],
relay: {
cursorType: 'ID',
},
scopeAuth: {
cacheKey: (value) => JSON.stringify(value),
authScopes: async (context) => ({
...
}),
},
prisma: {
client: db,
dmmf: Prisma.dmmf,
},
tracing: {
default: (config) => isRootField?.(config),
wrap: (resolver, options) => traceResolver(resolver, options),
},
});
builder.queryType();
builder.mutationType();
builder.addScalarType('DateTime', DateTimeResolver, {});
builder.addScalarType('JSONObject', JSONResolver, {});
export { builder };
// schema.prisma
generator pothos {
clientOutput = "@prisma/client"
provider = "prisma-pothos-types"
output = "./pothos-types.ts"
prismaUtils = true
}
Just tried upgrading my typescript from "typescript": "5.4.5" to "typescript": "5.5.4" and not I'm seeing this error when running pnpm type-check
from pothos.
Id recommend clearing out any tsbuildinfo files, and remove and reinstall node modules, and then restart vs code. If it's not showing up when you rub type checking via the cli, it might be a caching issue
from pothos.
Updated vs code to use my workspace version of typescript, instead of the default vs code (latest typescript) and it worked.
But looks like the issue is definitely with typescript 5.5.x
What version of ts are you using? Curious if this is just me or if other are having the same problem with ts 5.5.x
from pothos.
I've been using 5.5.4 without issues
from pothos.
ok thanks. I'll dig a little more on my end and see if I find anything.
from pothos.
We can leave this open for until we figure out whats going on. I just noticed you are using the validation plugin, which doesn't have a 4.0 version (its been renamed to plugin-zod)
from pothos.
Pushed up a repo with most of the code you provided on a branch of an old bug reproduction repo I had: https://github.com/hayes/pothos-prisma-alias-bug/tree/mh--expose-nullable-bug.
I wasn't able to reproduce the issue, but I am curious if this presents the same issue, or if you can expand it with whatever is missing that causes the issue
from pothos.
Related Issues (20)
- [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 list of enums TS bug 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))
- Define additional fields for prisma connection object
- How to find operations that have a specific option enabled? HOT 4
- Smart subscription async subscribe HOT 1
- Relay plugin should allow providing `last` argument by itself HOT 3
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.