Comments (11)
Great, I think that's enough info for me to get started on a PR.
from prisma-binding.
Great point! This should definitely be improved. The caching mechanism is intended however it should cache based on a schema level (so instead of a single cache variable there should be a cache map).
from prisma-binding.
Newcomer to the project; Git history shows graphql-schema-cache
previously used. Was there a reason for dropping it?
from prisma-binding.
Yes this was based on a different βarchitectureβ and is now no longer needed. It refers to another kind of cache than this issue describes.
from prisma-binding.
Another newcomer! I have another use case: i'm building a multi tenant system of which I am deploying multiple databases with identical schemas. E.g service-1@dev and service-2@dev.
I want to then switch the endpoint when creating a new Prisma instance on each request. E.g endpoint/service-1/dev and endpoint/service-2/dev.
However due to getCachedRemoteSchema
using the typeDefs
as the key, it's impossible to switch endpoints on the fly if the schemas are identical.
I've got it working by using the endpoint as the key. Is this a suitable solution for my use case?
from prisma-binding.
Hi there!
I have the same issue as @pollard93 , I can't switch between multiple endpoints having the same schema.
But I've found a solution which doesn't require me to fork this repo until a better solution is found.
I currently am doing a workaround by importing the typeDefs from the file myself and then appending a comment with the service and stage names. This makes the cache think the typedefs are different.
from prisma-binding.
@Errorname Nice workaround I'm now doing the same, thanks.
from prisma-binding.
Hey π, I believe this issue has been resolved in most recent versions of prisma-binding
. Taking @schickling's comment as a basis, I believe new implementation constructs a remote schema based on provided typeDefs
instead of blindly saving a global default.
More about this can be found in the cache.ts
file of prisma-binding
; I'll include the link below.
https://github.com/prisma/prisma-binding/blob/master/src/cache.ts
from prisma-binding.
Hey @maticzav !
Well, @pollard93 and I still have an issue with the current implementation. Here is our issue:
We both have a multi tenant system in which we created multiple services having the exact same schema (and therefore same provided typeDefs). Then, using prisma-binding, we try to register some (at least two) of our identical services. But, because they have the same typeDefs, the cache only sends requests to the first registered service!
In order to make a multi-tenant application with prisma-binding, we have to bypass the cache using the following trick:
For each of our services, we manually import the typeDefs file ourselves, and append a comment with the service and stage name. The cache is now fooled thinking they are different typeDefs and allow us to query independently our services.
I hope I explained why the cache is still a issue, at least for our use-case.
from prisma-binding.
I think a potential solution for our issue would be to cache based on the endpoint
instead of the typeDefs
from prisma-binding.
π This issue has been resolved in version 2.2.3 π
The release is available on:
Your semantic-release bot π¦π
from prisma-binding.
Related Issues (20)
- how to submit many transactions
- Connect Prisma Bindings to mock server
- Calling a query from Yoga to Prisma does nothing. HOT 5
- Case Sensitive Query Adjustments. HOT 2
- Calling multiple prisma requests returns same error to all the request if any one of them gives error.
- forwardTo() without having to specify resolver keys
- Cannot set property 'fragmentReplacements' of undefined HOT 1
- forwardTo with type rename
- how to get the count of records
- Howto define subscription endpoint
- Sub-selecting custom fields HOT 2
- Subscription Implementation with Prisma Binding
- Improve Code Readability
- error when trying to call aggregate function HOT 1
- Aliases still not works correctly
- How to filter `Where null` HOT 1
- Prisma() not recognized as a constructor HOT 1
- Import error on IResolvers from graphql-tools
- The automated release is failing π¨
- Version of this for graphql-code-generator ?
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-binding.