Skip to content

Instantly share code, notes, and snippets.

@gc-codesnippets
Created November 7, 2018 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gc-codesnippets/9fed79f71d23b3cd9c71fcadca65a9ea to your computer and use it in GitHub Desktop.
Save gc-codesnippets/9fed79f71d23b3cd9c71fcadca65a9ea to your computer and use it in GitHub Desktop.
// 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 = {}
export interface ArgsPost {
id: string
}
export type FeedResolver = (
parent: {},
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode[] | Promise<PostNode[]>
export type DraftsResolver = (
parent: {},
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode[] | Promise<PostNode[]>
export type PostResolver = (
parent: {},
args: ArgsPost,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | null | Promise<PostNode | null>
export interface Type {
feed: (
parent: {},
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode[] | Promise<PostNode[]>
drafts: (
parent: {},
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode[] | Promise<PostNode[]>
post: (
parent: {},
args: ArgsPost,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | null | Promise<PostNode | null>
}
}
export namespace MutationResolvers {
export const defaultResolvers = {}
export interface ArgsCreateDraft {
title: string
content: string
authorEmail: string
}
export interface ArgsDeletePost {
id: string
}
export interface ArgsPublish {
id: string
}
export type CreateDraftResolver = (
parent: {},
args: ArgsCreateDraft,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | Promise<PostNode>
export type DeletePostResolver = (
parent: {},
args: ArgsDeletePost,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | null | Promise<PostNode | null>
export type PublishResolver = (
parent: {},
args: ArgsPublish,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | null | Promise<PostNode | null>
export interface Type {
createDraft: (
parent: {},
args: ArgsCreateDraft,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | Promise<PostNode>
deletePost: (
parent: {},
args: ArgsDeletePost,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | null | Promise<PostNode | null>
publish: (
parent: {},
args: ArgsPublish,
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode | null | Promise<PostNode | null>
}
}
export namespace PostResolvers {
export const defaultResolvers = {
id: (parent: PostNode) => parent.id,
createdAt: (parent: PostNode) => parent.createdAt,
updatedAt: (parent: PostNode) => parent.updatedAt,
isPublished: (parent: PostNode) => parent.isPublished,
title: (parent: PostNode) => parent.title,
content: (parent: PostNode) => parent.content,
}
export type IdResolver = (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type CreatedAtResolver = (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type UpdatedAtResolver = (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type IsPublishedResolver = (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => boolean | Promise<boolean>
export type TitleResolver = (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type ContentResolver = (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type AuthorResolver = (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => UserNode | Promise<UserNode>
export interface Type {
id: (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
createdAt: (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
updatedAt: (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
isPublished: (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => boolean | Promise<boolean>
title: (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
content: (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
author: (
parent: PostNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => UserNode | Promise<UserNode>
}
}
export namespace UserResolvers {
export const defaultResolvers = {
id: (parent: UserNode) => parent.id,
name: (parent: UserNode) => parent.name,
email: (parent: UserNode) => parent.email,
createdAt: (parent: UserNode) => parent.createdAt,
}
export type IdResolver = (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type EmailResolver = (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type NameResolver = (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export type PostsResolver = (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode[] | Promise<PostNode[]>
export type CreatedAtResolver = (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
export interface Type {
id: (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
email: (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
name: (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
posts: (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => PostNode[] | Promise<PostNode[]>
createdAt: (
parent: UserNode,
args: {},
ctx: Context,
info: GraphQLResolveInfo,
) => string | Promise<string>
}
}
export interface Resolvers {
Query: QueryResolvers.Type
Mutation: MutationResolvers.Type
Post: PostResolvers.Type
User: UserResolvers.Type
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment