I'm a visual thinker primarily, I really need a di...
# orm-help
b
I'm a visual thinker primarily, I really need a diagram which shows the relation between Prisma Server, Prisma Bindings, Data Modelling, Query Engine, GraphQL Server, and Prisma Client Within the context of hooking Prisma to an existing PostgreSQL server. Unfortunately there just is not a straightforward A -> Z explanation and tutorial for this, which I understand given the rapid development and progress on the Prisma stack.
l
I'll take a swing in words. Several of the terms aren't amenable to a diagram because they don't relate to the others. Prisma Server: Where the Prisma Service is hosted. This is the application that takes your GraphQL query, translates it for the database, makes the db request, and sends the information back. Multiple services (e.g. app1, app2...) can be hosted on one server. Prisma Bindings: A specific version of GraphQL-Bindings that introspects a GraphQL API or consumes a GraphQL schema and generates a JS object representation of the API schema. In this case, the Prisma Service (running on the Prisma Server) API is reflected into an object, e.g.
query { users(where: {id}) { id } }
becomes
prismaBindings.query.users({ where: {id }}, '{id}')
One of the easiest ways to understand prisma bindings is to use the more generic graphql-bindings package to interact with another GraphQL endpoint, like Github Data Modeling: In a Prisma context, this is the file where you write your types for Prisma to translate into the database and Prisma service. Query Engine: Not sure about this one. I think it's referring to the engine Prisma uses to generate the queries. GraphQL server: A server that exchanges data according to the GraphQL spec. Prisma Client: Their blog post is the best on this, but I think of it as an addition to Prisma Bindings for querying and mutating data within the app and/or when my server data model (e.g. what's being shown to the outside world) is not a subset of my Prisma data model.
b
hmmm... Okay... thanks, Dennis!
It's not so much a definitions, it's the relationship between parts of the Prisma stack that I'm still vague on.
Also, isn't it
<Your GraphQL Server = {Schema, Resolvers}>
which points to the
<Prisma Server = {Datamodel, Generated Schema}>
in front of a SQL database? Where the
<Prisma Server>
is supposed to be instead of an ORM layer?