is that correct ?
# orm-help
z
is that correct ?
n
No.
How did you come to that impression?
z
I had to guess b/c I cannot find any documentation on this setup
in combination with docker-compose that is
n
I don't understand what you mean.
What has
docker-compose
to do with what you said earlier?
a
docker-compose has nothing to do with your endpoints
z
it defines how I setup the graphql instance
n
Can you help me understand what you mean, @zonofthor? It seems that you have some context that I don't.
z
I want to run a single GraphQL service on docker but which can serve many apps (endpoints)
prisma does this by service-name
<http://prisma/service1>
<http://prisma/service2>
but I'm not sure how GraphQL server does it
n
There are many different ways to solve this, and it generally has nothing to do with GraphQL. It's more a networking question.
z
indeed but the choice depends on how GraphQL best handles it, so you mean it's by different urls rather than ports ?
h
are you talking about prisma or yoga?
n
That's not what I mean, no.
z
yoga
sorry I'm probably confusing names... by GraphQL I mean the graphql based yoga server, on top of prisma
h
someone asked something similiar in #graphql-yoga
not sure if there's support for multiple services/schemas
z
I thought it was b/c it says in the github docs I can define different endpoints for yoga https://github.com/prisma/graphql-yoga
Copy code
const options = {
  port: 8000,
  endpoint: '/graphql',
  subscriptions: '/subscriptions',
  playground: '/playground',
}
a
let's just summarize what's possible one prisma instance many services many api server (yoga or whatnot) that always point ot a single service
z
ok, that really is what I needed to hear! So it's clear... to serve multiple apps I'd create multiple docker services - but they can all use the same prisma instance?
n
what are you trying to achieve in the end?
What @ashki is possible. Many other constellations are possible.
a
@nilan I'm just trying to list all the possible configurations not trying , it's not a question more of statement
👍 1
h
yes you'd probably want 2 docker containers for your services
then you could either use subdomains or paths with your reverse proxy
but how to set that up is another topic and is not really related to prisma at all
z
I can find that out if I just know what yoga expects
the yoga
options.endpoint
above confuses me, I understand it as if I can define different urls for same yoga server
n
This is what it does.
z
could you please explain?
h
It's paths for parts of the server
Like subscriptions and the normal endpoint use the same schema
n
the yoga
options.endpoint
above confuses me, I understand it as if I can define different urls for same yoga server
This understanding is correct.
You can define one different endpoint for your the GraphQL API that your
graphql-yoga
server exposes.
z
ok different urls but same schema ?
n
you can change the one endpoint that it exposes
z
I really don't understand how, surely the host defines the url (IP number) exposed to the outside?
n
It does
z
and inside a docker yoga is assigned url/IP
n
Using the options you shared above, you can manipulate different routes that are important in the context of GraphQL Yoga. Nothing more and nothing less.
z
ok different routes as on the frontend, got it
a
By reading the conversation it looks like you're lacking some core kowledge about docker-compose you should read up a bit on it
z
but to be absolute sure - that means still only one schema per yoga, 1:1
n
A GraphQL Yoga server exposes one GraphQL schema.
z
yes I'm new to backend setup but I'm learning
n
You can communicate to as many Prisma APIs behind the scenes as you want.
z
ok that is all I needed to know! in that case I'll setup seperate docker instances of yoga but single prisma api
n
You still haven't said what you want to achieve.
Yes, you can do what you just stated, but without knowing what you want to achieve I can't tell you if it makes sense or not.
z
single database/prisma for multiple frontends?
n
Is that a statement or a question?
z
it's a statement but unsure if correct terminology
n
I see
can you elaborate on "multiple frontends"
z
multiple (seperate) web applications
n
Ok
z
n
There is an alternative, using 2 databases and 2 prisma servers
Depending on your situation, either or is preferred.
z
are there any docs/tutorials/blogs about it - that you're aware of? (I haven't found any by Google)
h
you can also use one instance of yoga for multiple frontends
n
what do you mean with "it"?
h
oops, didn't mean to send that to general
😡 2
😓 1
gucci 1
z
about how to set this up
n
what do you mean with "this"?
z
single/multiple database/prisma for multiple frontends
just what we've discussed above
n
there are no resources coming to mind, no
z
thx I'll read that