Skip to content
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

Blitz codegen should import from the correct db folder #3881

Closed
Zeko369 opened this issue Oct 3, 2022 · 2 comments · Fixed by #3869
Closed

Blitz codegen should import from the correct db folder #3881

Zeko369 opened this issue Oct 3, 2022 · 2 comments · Fixed by #3869
Assignees
Labels
kind/bug Something isn't working status/done

Comments

@Zeko369
Copy link
Collaborator

Zeko369 commented Oct 3, 2022

What is the problem?

As of #3874, we allow users to have prisma/schema.prisma instead of the default db/schema.prisma.

What happens now is that our codegen generates resolvers with import db from "db", instead of checking package.json to see where the prisma folder is

Suggestion

Read pacakge.json to check where the schema.prisma is and assume that importing from that folder should be the index.ts with default export of PrismaClient

What are detailed steps to reproduce this?

  1. after Try to load prisma.schema path from pkg json #3874 is merged
  2. rename db to prisma
  3. change package.json prisma.schema to prisma/schema.prisma from db/schema.prisma
  4. blitz generate all todo title:string

All resolvers should import from "db" instead of "prisma"

Run blitz -v and paste the output here:

From whenever #3874 is merged

Please include below any other applicable logs and screenshots that show your problem:

No response

@Zeko369 Zeko369 added kind/bug Something isn't working status/triage labels Oct 3, 2022
@siddhsuresh
Copy link
Member

@Zeko369 I shall be fixing this in #3869

@Zeko369
Copy link
Collaborator Author

Zeko369 commented Oct 3, 2022

Amazing @siddhsuresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants