Skip to content

How to handle static generated inputs with relay plugin? #1251

Answered by hayes
lakhanmandloi asked this question in Q&A
Discussion options

You must be logged in to vote

I think this will be up to the app, and there isn't an easy answer.

The prisma-utils plugin doesn't have anything built in to handle this today.

I think exposing the raw ID as an Int field might be the best option for you here. When generating your schema from the DB, using the values as they exist in the DB is probably the right call. I think if you want to have a more tailored experience, you can customize the generator code to generate IDs as globalID inputs, and write a plugin that automatically decodes them to the right type, but doing this correctly isn't trivial.

These kinds of edge cases are why prisma-utils and generators are marked as experimental. They work well enough for the …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lakhanmandloi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants