hi all, i've got a (probably exotic) issue when at...
# orm-help
c
hi all, i've got a (probably exotic) issue when attempting to use
prisma-nexus
against two separate prisma services. for context, we need to talk to two database schemas, so due to this issue we've created two separate prisma services: https://github.com/prisma/prisma/issues/1622. this results in two prisma.ymls which are each generating their own
nexus-prisma.ts
. however, each file contains the following code:
Copy code
declare global {
  interface NexusPrismaGen extends NexusPrismaTypes {}
}
bc this is in the global namespace, it results in one set of nexus-generated types overriding the other. i'm uncertain of the motivation for using the global namespace here, but i'd be super interested if anyone has any suggestions for getting around this (or if it's a bug that should be filed). we really like working with prisma but i feel like this multi-schema thing is resulting in workarounds layered on workarounds. /cc @weakky @Nick Drane
d
Thanks for raising this @cedric, I persisted it here: https://github.com/prisma/nexus-prisma/issues/247
w
Hey @cedric, thanks for raising this! This is indeed a bug. The reason why we’re using a global type is because we want nexus & nexus-prisma type-safety to be fully transparent. While using nexus-prisma, no types are ever required to be imported to get auto-completion and type-safety. As a side-effect, typescript merges global interfaces when two have the same name