Hi, I have a question about Prisma, can I have a s...
# orm-help
a
Hi, I have a question about Prisma, can I have a single prisma instance with two separate GraphQL servers exposing different parts of the prisma schema? Lets say types the prisma schema contains the types A, B, C and I want one GraplQL server to expose types A, B, and another separate server to expose type C... is this possible? I realise this may be more related to what I would do with Apollo+Express, but any thoughts would be welcome 🙂
n
Yes, you can do that.
a
ok, so would I specify that by declaring another app in .graphqlconfig.yml ? Do you know where there is a definition for what's allowed/required in this file? Thank you!
n
You can do this either in two separate directories with each their own
.graphqlconfig.yml
file, or in a single directory with one
.graphqlconfig.yml
file. This entirely depends on your situation.
👍 1
g
What if the Server 1 and Server 2 are both remote? I assume you would then need something like
apollo-server
to stitch the two schemas together?
n
It sounds like @AzuriteJP is interested in running two separate GraphQL Servers, that are not stitched together
a
My idea, as yet just an idea from what I understand of GraphQL architecture possibilities, is to expose only what is required of a central data store (wrapped by Prisma) to specific clients, by providing custom servers (with specific schema) which are a subset of the larger single schema defined in Prisma... early days here! I have authentication and permissions to factor in also
n
when you say client do you mean software clients or humans?
a
I mean software client
the app I am building has an admin system, and a front facing website
n
yup, this is a very common case for running two GraphQL servers
a
the admin system does more than just provide data for the website
n
It doesn't mean that you have to use two servers, you can also only use one. Intuitively I would tend to splitting it up though. But again, this is a highly subjective discussion.
a
yep sure, I just expanded as I thought you were referring someone else to this thread.
n
yup, thanks for the additional context! 🙂