[unresolved] Hi friends, I just worked through the...
# orm-help
j
[unresolved] Hi friends, I just worked through the Prisma node.js tutorial on howtographql -- and was really blown away (especially coming from ruby's graphql) I some probably pretty basic architecture questions that I would love some help on. Which I will take into the thread (thanks all in advance who chime in):
consider an application that has the following requirements: 1) a react frontend 2) a slackbot "frontend" 3) periodic scheduled jobs interacting with the schema
I am sorry I am relatively new to the javascript / node work (coming from python and ruby)
the question is: do I create ONE application server that is hosting the GraphQLServer server AND the express server to handle slack call backs and other routes? (is that even possible)
OR two separate application servers, one that handles routing, and one that handles just the graphQLserver
m
Sorry, Im not really sure what you are trying to accomplish. You need to be a little more specific what you are trying to do, since things like
interacting with the schema
sound like a bit of a misunderstanding. In general, it is the simplest and most efficient approach to use Prisma database with Yoga server like showcased in the boilerplates. Then you have a highly capable server environment that interacts with your prisma db and where you can, for example, also receive slack callbacks. I suggest you use one of the boilerplates on https://github.com/graphql-boilerplates, you can setup everything with
graphql create
like shown in the boilerplate readmes. Playing around with the environment a bit should answer a lot of your questions. Good luck!
j
thanks moritz (let me take a quick look at those to see if that does the trick -- or I'll make my question more explicit)
ok -- I think I can boil down the question to the following. via an index.js (like: https://github.com/graphql-boilerplates/react-fullstack-graphql/blob/master/advanced/server/src/index.js) file I am running a GraphQLServer on port 4000. What is the best wayto expose an endpoint to consume a non-graphql http callback from slack say [POST] /api/slack/events?