Open
Description
You can currently use numeric IDs / cursors, but you have to manually pass the generic: https://github.com/devoxa/prisma-relay-cursor-connection/blob/master/tests/index.spec.ts#L194
// v Model type
const result = await findManyCursorConnection<User, { id: number }>(
// ^ Cursor generic
You can also not use select
or include
, because of the manually provided generics.
With some TS magic (that I could not figure out so far) it might be possible to make this automatically infer the correct types.
If someone want to take a stab at it, I provided some additional tests & type checks on the https://github.com/devoxa/prisma-relay-cursor-connection/tree/fix-generics-with-number-id-2 branch. The tests already pass (as expected) but the type checks in the test file do not.