Skip to content

Instantly share code, notes, and snippets.

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") {
*
}
}`
type User {
id: ID! @id
createdAt: DateTime!
updatedAt: DateTime!
firstName: String!
lastName: String!
email: String! @unique
password: String!
phone: String!
responseRate: Float
// 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 = {}
async signup(parent, args, ctx, info) {
args.email = args.email.toLowerCase();
const password = await bcrypt.hash(args.password, 10);
const user = await ctx.db.mutation.createUser(
{
data: {
...args,
password,
permissions: { set: ['USER'] },
},
# source: https://eu1.prisma.sh/nikolas/fduivg/dev
# timestamp: Sat May 12 2018 15:13:56 GMT+0200 (CEST)
type AggregateUser {
count: Int!
}
type BatchPayload {
"""The number of nodes that have been affected by the Batch operation."""
count: Long!
# source: https://eu1.prisma.sh/nikolas/fduivg/dev
# timestamp: Sat May 12 2018 15:07:31 GMT+0200 (CEST)
type AggregateUser {
count: Int!
}
type BatchPayload {
"""The number of nodes that have been affected by the Batch operation."""
count: Long!