Comments (6)
What you could currently do if you manage your Prisma backends outside of your Graphl Server project, is use prisma-bindings
and add the Prisma backends as regular endpoints (so without the prisma extension in the config). That way, they would behave like any other endpoint.
It would allow you to add two Prisma bindings to your context. Is your example, you are adding two endpoints to a single binding, but I don't see any benefit over using two bindings.
from prisma-binding.
I have a use case that involves multiple Prisma APIs to bind against. After trying to create two separate Prisma
objects in context, I noticed that they both ended up pointing to the same schema and endpoint. If I understand the conversation correctly so far, that means @kbrandwijk 's suggestion will not behave as expected.
The problem appears to be rooted in the global variable for remoteSchema
https://github.com/graphcool/prisma-binding/blob/2117ddffdad990867616505ef80f618e4628a21d/src/Prisma.ts#L16. If I construct a Prisma
pointed at a particular schema, then a second one, both instances will use the first schema provided due to the check on line 59 https://github.com/graphcool/prisma-binding/blob/2117ddffdad990867616505ef80f618e4628a21d/src/Prisma.ts#L59.
I haven't used TypeScript before, but I could try to put in a patch. Changes were introduced in 67612e9; any fix would probably benefit from understanding why the remote schema caching was changed.
from prisma-binding.
@a-type That is a very good point, thank you for bringing this up. I have created #81 for this.
from prisma-binding.
@a-type would you be open creating a PR for this (see #81)?
from prisma-binding.
@schickling Sure, I'll look into doing that soon. Be advised that I've never written Typescript before, but hopefully this is a fairly trivial change.
from prisma-binding.
Fixed with #81
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.