Skip to content

Instantly share code, notes, and snippets.

type Query {
posts: [Post!]!
post(id: ID!): Post
}
type Mutation {
createDraft(title: String!, content: String): Post
deletePost(id: ID!): Post
publish(id: ID!): Post
}
type User {
id: ID! @id
createdAt: DateTime!
updatedAt: DateTime!
firstName: String!
lastName: String!
email: String! @unique
password: String!
phone: String!
responseRate: Float
# THIS FILE HAS BEEN AUTO-GENERATED BY THE "GRAPHCOOL DEPLOY"
# DO NOT EDIT THIS FILE DIRECTLY
#
# Model Types
#
type User implements Node {
id: ID!
name: String!
# THIS FILE HAS BEEN AUTO-GENERATED BY "PRISMA DEPLOY"
# DO NOT EDIT THIS FILE DIRECTLY
#
# Model Types
#
type User implements Node {
id: ID!
name: String!
import type { Context } from '../../';
type EditReleaseInput = {
data: {
releaseId: string,
title?: string,
},
};
export default async (
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 }),
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() {
type MyCustomDef struct {
}
myRes := MyCustomDef{}
err := prisma.GraphQL(`{
users {
*
}
const query1 = `{
user(id: "$id") {
*
}
}`
type query1 = `{
user(id: "$id") {
*
}
}`
// Code generated by github.com/prisma/graphqlgen, DO NOT EDIT.
import { GraphQLResolveInfo } from 'graphql'
import { Context } from '../types'
import { PostNode } from './prisma-client'
import { UserNode } from './prisma-client'
export namespace QueryResolvers {
export const defaultResolvers = {}