-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support Entities With id: Int
?
#938
Comments
This supports number IDs (see tests). Your error talks about |
This is also supported (see here) and without more surrounding code it's impossible to debug your issue. |
I see this original issue and followed it through to the merged PR, but the code looks to have changed since the original issue. I also noticed the tests and the apparent proof that it can work. When I tried it, my https://github.com/devoxa/prisma-relay-cursor-connection/blob/master/tests/index.spec.ts#L173 |
I just added a regression test for your use-case just to make sure it works. It does, but you do have to manually pass the generic: https://github.com/devoxa/prisma-relay-cursor-connection/blob/master/tests/index.spec.ts#L194 // v Your model type
const result = await findManyCursorConnection<User, { id: number }>(
// ^ Your cursor generic I added a follow up-issue to make this easier: #944 |
Ah yeah. I added that to #944.
I agree with this, I added a branch that adds some (failing) type tests for this case, but I could not figure out how to make this work. PRs welcome! |
@queicherius Thanks! I couldn't figure out the types either in all my tinkering. If I figure it out, I'll contribute back here. |
Hello! Thanks for this package. I'm implementing it in a code base to transition from prisma1 -> prisma5. I ran into an issue where the types don't appear to be flowing and I'm unable to call
findManyCursorConnection
. It's a pretty simple call site butfindManyCursorConnection
doesn't appear to be inferring the correct types.The error is:
![CleanShot 2024-08-28 at 15 03 39@2x](https://private-user-images.githubusercontent.com/2034823/362451932-7d87fae8-f48a-4555-a4d8-42d6702bbf2b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MzgwODMsIm5iZiI6MTczOTQzNzc4MywicGF0aCI6Ii8yMDM0ODIzLzM2MjQ1MTkzMi03ZDg3ZmFlOC1mNDhhLTQ1NTUtYTRkOC00MmQ2NzAyYmJmMmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMDkwOTQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWYyN2E3ZjQ3NmFjNTZlYmFkYzQxM2U4ZWJkOTY5OWYzZjVhN2FjMmZmZWJhYjE0NGRiMDUxMDQyYTM1NTFhMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.itV9EYPNgwVIScb0VDnA_cnacCRLHInj8FTGEBerq0k)
My schema looks like this. Is it because of the
![image](https://private-user-images.githubusercontent.com/2034823/362452019-0e1b68f7-37fd-4609-8dfc-2566673e6efb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MzgwODMsIm5iZiI6MTczOTQzNzc4MywicGF0aCI6Ii8yMDM0ODIzLzM2MjQ1MjAxOS0wZTFiNjhmNy0zN2ZkLTQ2MDktOGRmYy0yNTY2NjczZTZlZmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMDkwOTQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDM2NzQwYjNmN2FmMDY0NTkzNWE0MjFjM2MyYTc3OWI3MGJiMzJlYTEyZmViNzJkMWU1ODlmMzFiMzE5ZDVlYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.daMiCvdbpeGbWB64apTW5M2DADIWrC7eJ3iyfJgFjLM)
id: Int
in my Prisma schema?The text was updated successfully, but these errors were encountered: