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

[BUG]: Relation Query type merges when using the same "with" key #2343

Open
khuezy opened this issue May 17, 2024 · 0 comments
Open

[BUG]: Relation Query type merges when using the same "with" key #2343

khuezy opened this issue May 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@khuezy
Copy link

khuezy commented May 17, 2024

What version of drizzle-orm are you using?

0.30.10

What version of drizzle-kit are you using?

0.21.13

Describe the Bug

schema:

author: text('id') // a reference to the author id

relation:

author: one(author, {... // notice the same key as the schema "author"

query:

with: {
   author: true // The "author" should be the data from the author table, and not the "id" reference
}

This results is type: author: (string & {what ever type the relation query is})

Expected behavior

When using with: sameKeyAsSchema, the types shouldn't merge. It should use the types from the with relation.

Environment & setup

No response

@khuezy khuezy added the bug Something isn't working label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant