Created
November 30, 2018 22:58
-
-
Save gc-codesnippets/520f62428cbb696776a1a9a3b39f4ee2 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 { idArg } from 'gqliteral' | |
import { prismaObjectType } from '../../../plugin' | |
import { prisma } from '../../generated/prisma-client' | |
export const Query = prismaObjectType('Query', t => { | |
t.prismaFields(['products', 'options', 'brands']) | |
t.field('otherProduct', 'Product', { | |
args: { id: idArg({ required: true }) }, | |
resolve: (parent, { id }) => prisma.product({ id }), | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment