brant
06/08/2018, 5:54 PMnilan
06/08/2018, 6:51 PMbrant
06/08/2018, 6:52 PMbrant
06/08/2018, 6:52 PMnilan
06/08/2018, 6:53 PMnilan
06/08/2018, 6:54 PMschema.graphql
2) create a new, empty resolver somewhere and import it into the GraphQL server (probably in index.js. You can compare this to how other resolvers end up being there.
3) In the still empty resolver, use prisma-binding to implement your logic.nilan
06/08/2018, 6:54 PMfeed querynilan
06/08/2018, 6:55 PMbrant
06/08/2018, 6:56 PMbrant
06/08/2018, 7:55 PMtype User {
id: ID!
name: String!
email: String!
posts: [Link!]!
}
and a resolver that looks like this:
async function user(parent, { id }, ctx, info) {
return ctx.db.query.user({ where: { id } }, info)
}
should the Posts be populated “magically” or do I need to write a query in the resolver to grab the posts where the user ID matches?Andrew Mead
06/08/2018, 7:59 PMbrant
06/08/2018, 8:00 PMAndrew Mead
06/08/2018, 8:00 PMbrant
06/08/2018, 8:01 PMAndrew Mead
06/08/2018, 8:01 PMbrant
06/08/2018, 8:01 PMbrant
06/08/2018, 8:14 PMuser I think the issue may be that my types are different between schema.graphql and datamodel.graphqlAndrew Mead
06/08/2018, 8:29 PMbrant
06/08/2018, 8:29 PM