Comments (4)
@brikou the reason is, that when you want to use the Dataloader with full Cache later, you don't need to change your code. So this basically means, that on each request, a new Client instance is created. It's not used right now, but will later help to enable caching on a request basis.
Does this answer your question?
from prisma-examples.
Ok I see but since cache is not used, we should remove it. Then add an example with this cache feature. Thanks for your insight.
from prisma-examples.
The intention of this is to establish patterns we think will help for working with Prisma. By attaching the Prisma within context, we establish a pattern for your code that can take advantage of caching once we enable that feature. When we release it people can take advantage of it for free.
By all means though import Prisma in your own files if it makes sense for you
from prisma-examples.
Thanks @abhiaiyer91, can't wait to see the cache feature coming
from prisma-examples.
Related Issues (20)
- Update NestJS examples to no longer use beforeExit hook HOT 2
- Improve Next.js Rest API example
- GraphQL next.js example not working
- GraphQL Next.js example missing dependencies
- nuxt 3 prisma example not working on production HOT 1
- nuxtjs3 - db.ts example code does not match the referenced documentation page HOT 1
- nuxtjs3 - rest-nuxtjs example
- how to package prisma
- One-to-many relationship
- tutorial out of date: End-To-End Type-Safety with GraphQL, Prisma & React HOT 2
- Unauthorized Error when Creating a New Post HOT 1
- `typescript/rest-nextjs-express` doesn't work with `try-prisma`
- The domain try-prisma-analytics.com has expired
- Generate types from prisma schema models
- prisma-indexes HOT 1
- MongoDB indexes don't work with `prismagraphql/mongo-single-replica`
- PothosSchemaError: Ref ObjectRef<Profile> has not been implemented HOT 1
- postgresql-supabase instructions missing db seed step
- fix(typescript/trpc-nextjs): typo "singupUser" instead of "signupUser"
- chore(typescript/rest-nestjs): remove unused dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma-examples.