Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

error with @nexus/schema and apollo #63

Closed
asaadawey opened this issue Oct 5, 2020 · 4 comments
Closed

error with @nexus/schema and apollo #63

asaadawey opened this issue Oct 5, 2020 · 4 comments

Comments

@asaadawey
Copy link

i can't get prisma multi tenant to work with @nexus/schema

the @nexus/schema came with prisma/cli out of the box
But the prisma-multi-tenant requires prisma/cli and here is the issue

When @prisma/cli installed as dependancy . i got the following error

Error: You most likely forgot to initialize the Prisma Client. Please run `prisma generate` and try to run it again.
If that does not solve your problem, please open an issue.
    at Object.exports.getPrismaClientDmmf (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\nexus-plugin-prisma\src\schema\dmmf\utils.ts:16:11)
    at Object.exports.getTransformedDmmf (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\nexus-plugin-prisma\src\schema\dmmf\transformer.ts:16:47)
    at new SchemaBuilder (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\nexus-plugin-prisma\src\schema\builder.ts:257:7)
    at Object.build (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\nexus-plugin-prisma\src\schema\builder.ts:176:19)
    at Object.onInstall (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\nexus-plugin-prisma\src\schema\index.ts:46:62)
    at D:\7SSCarRentalProject2\CarRental-Backend\node_modules\@nexus\schema\src\builder.ts:657:44
    at Array.forEach (<anonymous>)
    at SchemaBuilder.beforeWalkTypes (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\@nexus\schema\src\builder.ts:651:18)
    at SchemaBuilder.getFinalTypeMap (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\@nexus\schema\src\builder.ts:741:10)
    at makeSchemaInternal (D:\7SSCarRentalProject2\CarRental-Backend\node_modules\@nexus\schema\src\builder.ts:1461:92)
[ERROR] 14:59:16 Error: You most likely forgot to initialize the Prisma Client. Please run `prisma generate` and try to run it again.
If that does not solve your problem, please open an issue.

When i remove @prisma/cli i got the following error in runtime

"message": "Context creation failed: \n\u001b[31mInvalid \u001b[1mprisma.tenant.findOne()\u001b[22m invocation:\u001b[39m\n\n\n Error in connector: Error querying the database: db error: ERROR: zero-length delimited identifier at or near \"\"\"\"",

@asaadawey
Copy link
Author

I think here is the main problem

  Error in connector: Error querying the database: db error: ERROR: zero-length delimited identifier at or near """"
    at PrismaClientFetcher.request (D:\7SSCarRentalProject\NewCode\Backend\node_modules\.prisma-multi-tenant\management\runtime\index.js:1:228459)

@dlehmhus
Copy link

@asaadawey i had the same problem. A dirty fix for me was removing the @prisma folder from @nexus/schema node_modules folder before generating the nexus prisma schema.

@Pranit-Harekar
Copy link

Pranit-Harekar commented Oct 22, 2020

I fixed it by removing ?schema=public from the end of pg database URL that you specify in .env file and also by removing the double quotes

@Errorname
Copy link
Owner

Hi everyone! This was probably related to this issue: #60 that has been fixed with the release of 2.4.1. If you still encounter this issue, please don't hesitate to reopen. Thanks for your patience 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants