Created
November 19, 2018 23:09
-
-
Save gc-codesnippets/83abf3aa518de9fbf2f10920b14a4176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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