Skip to content

Instantly share code, notes, and snippets.

@gc-codesnippets
Created November 19, 2018 23:09
Show Gist options
  • Save gc-codesnippets/83abf3aa518de9fbf2f10920b14a4176 to your computer and use it in GitHub Desktop.
Save gc-codesnippets/83abf3aa518de9fbf2f10920b14a4176 to your computer and use it in GitHub Desktop.
import { PostResolvers } from '../generated/graphqlgen'
import { prisma } from '../generated/prisma-client';
export const Post: PostResolvers.Type = {
...PostResolvers.defaultResolvers,
published: parent => parent.isPublished,
author: (parent, args, ctx) => ctx.db.post({ id: parent.id }).author(),
}
async function main() {
const result = await prisma.post({id: 'sdf'}).author().posts()
const result2 = await prisma.$deep.post({id: 'sdf'}).author().posts()
}
const res = await prisma.$graphql<MyResposneType>(`{
user {
}
}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment