We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
graphql-yoga
I've updated my dependencies and the error started happening.
My package.json:
package.json
{ "name": "server", "version": "1.0.50", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "bun run --watch src/index.ts" }, "dependencies": { "@elysiajs/cors": "^0.7.1", "@elysiajs/graphql-yoga": "^0.6.3", "@elysiajs/swagger": "^0.7.3", "elysia": "latest" }, "devDependencies": { "bun-types": "latest", "eslint-config-standard-with-typescript": "latest", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0 || ^16.0.0", "eslint-plugin-promise": "^6.0.0" }, "module": "src/index.js" }
I think my code is following the plugin usage examples and, before the update, it was working without errors.
I'm getting this error in terminal when running the server:
[0] 38 | ? void 0 [0] 39 | : _value$constructor.name; [0] 40 | [0] 41 | if (className === valueClassName) { [0] 42 | const stringifiedValue = (0, _inspect.inspect)(value); [0] 43 | throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm. [0] ^ [0] error: Cannot use GraphQLObjectType "User" from another module or realm.
It says me to verify my node_modules for duplicate graphql instances, I have only one:
graphql
> ls ... drwxr-xr-x - dtsf dtsf 7 Oct 11:01 graphql drwxr-xr-x - dtsf dtsf 7 Oct 11:01 graphql-mobius drwxr-xr-x - dtsf dtsf 7 Oct 11:01 graphql-yoga
const app = new Elysia() .use( yoga({ typeDefs: /* GraphQL */` type User { id: ID! name: String! email: String! banned: Boolean! } type Query { user(id: ID): [User] createUser(name: String!, email: String!): User banUser(id: ID!): User } `, resolvers: { Query: { user: (_, args) => { if (args?.id) { const query = db.query("SELECT * FROM users WHERE id = $id") const result = query.all({ $id: args.id }) return result as User[] } else { const query = db.query("SELECT * FROM users") const result = query.all() return result as User[] } }, createUser: (_, args) => { const id = Math.random().toString(36).substring(7) const user = { id, name: args.name, email: args.email, banned: false } const query = db.prepare("INSERT INTO users (id, name, email, banned) VALUES ($id, $name, $email, $banned)") query.run({ $id: user.id, $name: user.name, $email: user.email, $banned: user.banned }) return user }, banUser: (_, args) => { const user = db.query("SELECT * FROM users WHERE id = $id").get({ $id: args.id }) as User | undefined if (!user) return null const query = db.prepare("UPDATE users SET banned = $banned WHERE id = $id") if (user.banned) query.run({ $id: args.id, $banned: false }) else query.run({ $id: args.id, $banned: true }) return { ...user, banned: !user.banned } } } } }) )
The no overload matches this call ts error:
no overload matches this call
The last overload gave the following error: │ Argument of type '(app: Elysia) => Elysia<"", { request: {}; store: {}; schema: {}; error: {}; meta: Record<"defs", {}> & Record<"exposed", {}> & Record<"schema", { [x: string]: { get: { body: unknown; headers: undefined; query: undefined; params: undefined; response: { ...; }; }; } & { ...; }; }>; }>' is not assignable to parameter of type 'Promise<{ default: Elysia<any, any, any, any, any, any>; }>'.
Observation:
I'm not very good at reading those types. I don't know if I did anything wrong here. Sorry to bother if it's the case.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Context
I've updated my dependencies and the error started happening.
My
package.json
:Description
I think my code is following the plugin usage examples and, before the update, it was working without errors.
I'm getting this error in terminal when running the server:
It says me to verify my node_modules for duplicate
graphql
instances, I have only one:> ls ... drwxr-xr-x - dtsf dtsf 7 Oct 11:01 graphql drwxr-xr-x - dtsf dtsf 7 Oct 11:01 graphql-mobius drwxr-xr-x - dtsf dtsf 7 Oct 11:01 graphql-yoga
The code
The
no overload matches this call
ts error:Observation:
I'm not very good at reading those types. I don't know if I did anything wrong here. Sorry to bother if it's the case.
The text was updated successfully, but these errors were encountered: