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 type { Context } from '../../'; | |
type EditReleaseInput = { | |
data: { | |
releaseId: string, | |
title?: string, | |
}, | |
}; | |
export default async ( |
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 }), |
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() { |
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
type MyCustomDef struct { | |
} | |
myRes := MyCustomDef{} | |
err := prisma.GraphQL(`{ | |
users { | |
* | |
} |
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
const query1 = `{ | |
user(id: "$id") { | |
* | |
} | |
}` | |
type query1 = `{ | |
user(id: "$id") { | |
* | |
} | |
}` |
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
type User { | |
id: ID! @id | |
createdAt: DateTime! | |
updatedAt: DateTime! | |
firstName: String! | |
lastName: String! | |
email: String! @unique | |
password: String! | |
phone: String! | |
responseRate: Float |
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
// 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 = {} |
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
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'] }, | |
}, |
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
# 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! |
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
# 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! |
NewerOlder