Giter VIP home page Giter VIP logo

Comments (6)

kbrandwijk avatar kbrandwijk commented on May 24, 2024

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.

a-type avatar a-type commented on May 24, 2024

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.

kbrandwijk avatar kbrandwijk commented on May 24, 2024

@a-type That is a very good point, thank you for bringing this up. I have created #81 for this.

from prisma-binding.

schickling avatar schickling commented on May 24, 2024

@a-type would you be open creating a PR for this (see #81)?

from prisma-binding.

a-type avatar a-type commented on May 24, 2024

@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.

maticzav avatar maticzav commented on May 24, 2024

Fixed with #81

from prisma-binding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.