maybe this is not possible?
# orm-help
l
maybe this is not possible?
g
I prob won’t be able to help you, but FYI without any examples you can’t really expect anyone to know what you’re attempting to do. I suggest you provide an example of some code you wrote, like your resolver. Or even better a stripped down example repo with everything in place showing the issue you have.
l
I did above last night
but maybe I’ll make a repo
thanks!
g
ah I see, only seen your messages today
are you using prisma client?
l
yes
Prisma 1.17
g
prisma client doesn’t forward queries
l
yeah I posted snippets of my data mode, query, resolvers, and log output last night
g
I had the same issue over the last few days
ended up reverting back to the binding lib
l
what did you do ?
g
so you can pass the info object
l
what does passing the info object do?
g
its not really documented well to be honest
l
it’s frustrating
g
yeah I considered AWS app sync, but I’m migrating to an existing graphcool app. Migrating to app sync could end up taking longer
l
this is just for a side project for me
and everytime I go to work on it
prisma has updated
and changed the api
and I spend all my time updating to fix everything that broke
g
yeah 1.7 docs do make it a bit confusing with the new prisma client
l
I wish there was an interactive console
where I could use the prisma-client api
g
prisma-binding is the lib that forwards info btw
thats what I’m using instead of prisma-client
l
what version of prisma is that associated with?
g
its not deprecated, it’s meant to coexist
l
but doesnt 1.17 mean you need to use prisma-client ?
g
no
its jsut a lib
l
its not going to be deprecated?
in favor of client?
g
heres an example of how I use both atm:
Copy code
const { Prisma } = require("prisma-binding");

const { prisma } = require("../prisma/prisma-client");

const db = new Prisma({
  typeDefs: "prisma/graphql-schema/prisma.graphql",
  endpoint: "<http://prisma:4466/api/dev>",
  secret: "abcd1234"
});


const server = new GraphQLServer({
  typeDefs: "src/schema.graphql",
  resolvers,
  context: req => ({
    ...req,
    prisma,
    db
  }),
  formatError: error => {
    console.log(error);
    return error;
  },
  formatResponse: response => {
    console.log(response);
    return response;
  }
});
check out the blog post for it
l
thank you!
g
np
l
so if you need to use
prisma generate
for prisma client
how do you generate the code for prisma-binding
g
you can have multiple generators in the prisma.yml:
Copy code
datamodel: ./prisma/datamodel.graphql
endpoint: <http://prisma:4466/api/dev>
secret: abcd1234
generate:
  - generator: javascript-client
    output: ./prisma/prisma-client/
  - generator: graphql-schema
    output: ./prisma/graphql-schema/
l
oh man
thanks
g
no worries
l
this is so confusing
g
lol yeah at first
w
This is a blog post about the info object if you want to know some more informations about it... https://www.prisma.io/blog/graphql-server-basics-demystifying-the-info-argument-in-graphql-resolvers-6f26249f613a/
n
@Luke this might be interesting for you regarding the client vs bindings discussion: https://www.prisma.io/forum/t/help-understanding-prisma-clients-value-proposition/4394/17?u=nikolas
l
@nikolasburk Thank you!!!
🙌 1
n
FYI, we've also a section to the "Common resolver patterns" guide about this topic here: https://www.prisma.io/tutorials/a-guide-to-common-resolver-patterns-ct08/#scenario:-implementing-relations-with-prisma-client