-
Notifications
You must be signed in to change notification settings - Fork 14
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
Usage - Can this be used on server? #13
Comments
Also this library requires |
If you want to use this on the server, you need to use the |
@pantharshit00 can you provide a code example of how to set up prismatic backend with yoga that uses caching? What you wrote I found already on forums but I never figured out how to do it. |
Prisma client internally uses this package. You can see the example usage here: https://github.com/prisma/prisma/blob/e8e6c857fa9dec2bede16cda2e628abf2980410b/cli/packages/prisma-client-lib/src/Client.ts#L19 |
Hey, thanks for the link. I have seen this code before and what puzzles me is that if I execute the same query twice using prisma client it hits the database twice. That’s my problem, I do not understand why prisma is not caching data. |
I am a bit confused. If I understand this right, I can use this link on my Yoga server to cache and batch requests towards the Prisma. But where do I actually initialise this? This is the code for inititialising prisma connection inside GraphQL server. Where does it go? I know that links are used on client, not in server, yet your documentation states otherwise. If this is not the case, how can I cache queries on server?
The text was updated successfully, but these errors were encountered: