Skip to content

Commit

Permalink
Merge pull request #3916 from adamgajzlerowicz/update-prisma-example
Browse files Browse the repository at this point in the history
sample(prisma): update broken prisma sample
  • Loading branch information
kamilmysliwiec authored Jan 26, 2020
2 parents 12b0efe + ce1c044 commit f9eebfa
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 156 deletions.
2 changes: 1 addition & 1 deletion sample/22-graphql-prisma/database/datamodel.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type Post {
id: ID! @unique
id: ID! @unique @id
isPublished: Boolean! @default(value: false)
title: String!
text: String!
Expand Down
2 changes: 1 addition & 1 deletion sample/22-graphql-prisma/src/graphql.options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { join } from 'path';
export class GraphqlOptions implements GqlOptionsFactory {
createGqlOptions(): Promise<GqlModuleOptions> | GqlModuleOptions {
return {
typePaths: ['./**/*.graphql'],
typePaths: ['./src/**/*.graphql'],
path: '/',
installSubscriptionHandlers: true,
resolverValidationOptions: {
Expand Down
267 changes: 123 additions & 144 deletions sample/22-graphql-prisma/src/graphql.schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,201 +1,180 @@

/** ------------------------------------------------------
* THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
* -------------------------------------------------------
*/

/* tslint:disable */
export enum MutationType {
CREATED = 'CREATED',
UPDATED = 'UPDATED',
DELETED = 'DELETED',
CREATED = "CREATED",
UPDATED = "UPDATED",
DELETED = "DELETED"
}

export enum PostOrderByInput {
id_ASC = 'id_ASC',
id_DESC = 'id_DESC',
isPublished_ASC = 'isPublished_ASC',
isPublished_DESC = 'isPublished_DESC',
title_ASC = 'title_ASC',
title_DESC = 'title_DESC',
text_ASC = 'text_ASC',
text_DESC = 'text_DESC',
updatedAt_ASC = 'updatedAt_ASC',
updatedAt_DESC = 'updatedAt_DESC',
createdAt_ASC = 'createdAt_ASC',
createdAt_DESC = 'createdAt_DESC',
id_ASC = "id_ASC",
id_DESC = "id_DESC",
isPublished_ASC = "isPublished_ASC",
isPublished_DESC = "isPublished_DESC",
title_ASC = "title_ASC",
title_DESC = "title_DESC",
text_ASC = "text_ASC",
text_DESC = "text_DESC"
}

export class PostCreateInput {
isPublished?: boolean;
title: string;
text: string;
id?: string;
isPublished?: boolean;
title: string;
text: string;
}

export class PostSubscriptionWhereInput {
AND: PostSubscriptionWhereInput[];
OR: PostSubscriptionWhereInput[];
NOT: PostSubscriptionWhereInput[];
mutation_in: MutationType[];
updatedFields_contains?: string;
updatedFields_contains_every: string[];
updatedFields_contains_some: string[];
node?: PostWhereInput;
AND?: PostSubscriptionWhereInput[];
OR?: PostSubscriptionWhereInput[];
NOT?: PostSubscriptionWhereInput[];
mutation_in?: MutationType[];
updatedFields_contains?: string;
updatedFields_contains_every?: string[];
updatedFields_contains_some?: string[];
node?: PostWhereInput;
}

export class PostUpdateInput {
isPublished?: boolean;
title?: string;
text?: string;
isPublished?: boolean;
title?: string;
text?: string;
}

export class PostUpdateManyMutationInput {
isPublished?: boolean;
title?: string;
text?: string;
}

export class PostWhereInput {
AND: PostWhereInput[];
OR: PostWhereInput[];
NOT: PostWhereInput[];
id?: string;
id_not?: string;
id_in: string[];
id_not_in: string[];
id_lt?: string;
id_lte?: string;
id_gt?: string;
id_gte?: string;
id_contains?: string;
id_not_contains?: string;
id_starts_with?: string;
id_not_starts_with?: string;
id_ends_with?: string;
id_not_ends_with?: string;
isPublished?: boolean;
isPublished_not?: boolean;
title?: string;
title_not?: string;
title_in: string[];
title_not_in: string[];
title_lt?: string;
title_lte?: string;
title_gt?: string;
title_gte?: string;
title_contains?: string;
title_not_contains?: string;
title_starts_with?: string;
title_not_starts_with?: string;
title_ends_with?: string;
title_not_ends_with?: string;
text?: string;
text_not?: string;
text_in: string[];
text_not_in: string[];
text_lt?: string;
text_lte?: string;
text_gt?: string;
text_gte?: string;
text_contains?: string;
text_not_contains?: string;
text_starts_with?: string;
text_not_starts_with?: string;
text_ends_with?: string;
text_not_ends_with?: string;
AND?: PostWhereInput[];
OR?: PostWhereInput[];
NOT?: PostWhereInput[];
id?: string;
id_not?: string;
id_in?: string[];
id_not_in?: string[];
id_lt?: string;
id_lte?: string;
id_gt?: string;
id_gte?: string;
id_contains?: string;
id_not_contains?: string;
id_starts_with?: string;
id_not_starts_with?: string;
id_ends_with?: string;
id_not_ends_with?: string;
isPublished?: boolean;
isPublished_not?: boolean;
title?: string;
title_not?: string;
title_in?: string[];
title_not_in?: string[];
title_lt?: string;
title_lte?: string;
title_gt?: string;
title_gte?: string;
title_contains?: string;
title_not_contains?: string;
title_starts_with?: string;
title_not_starts_with?: string;
title_ends_with?: string;
title_not_ends_with?: string;
text?: string;
text_not?: string;
text_in?: string[];
text_not_in?: string[];
text_lt?: string;
text_lte?: string;
text_gt?: string;
text_gte?: string;
text_contains?: string;
text_not_contains?: string;
text_starts_with?: string;
text_not_starts_with?: string;
text_ends_with?: string;
text_not_ends_with?: string;
}

export class PostWhereUniqueInput {
id?: string;
id?: string;
}

export interface Node {
id: string;
id: string;
}

export class AggregatePost {
count: number;
count: number;
}

export class BatchPayload {
count: Long;
count: Long;
}

export abstract class IMutation {
abstract createPost(data: PostCreateInput): Post | Promise<Post>;
abstract updatePost(
data: PostUpdateInput,
where: PostWhereUniqueInput,
): Post | Promise<Post>;
abstract deletePost(where: PostWhereUniqueInput): Post | Promise<Post>;
abstract upsertPost(
where: PostWhereUniqueInput,
create: PostCreateInput,
update: PostUpdateInput,
): Post | Promise<Post>;
abstract updateManyPosts(
data: PostUpdateInput,
where?: PostWhereInput,
): BatchPayload | Promise<BatchPayload>;
abstract deleteManyPosts(
where?: PostWhereInput,
): BatchPayload | Promise<BatchPayload>;
abstract createPost(data: PostCreateInput): Post | Promise<Post>;
abstract updatePost(data: PostUpdateInput, where: PostWhereUniqueInput): Post | Promise<Post>;
abstract deletePost(where: PostWhereUniqueInput): Post | Promise<Post>;
abstract upsertPost(where: PostWhereUniqueInput, create: PostCreateInput, update: PostUpdateInput): Post | Promise<Post>;
abstract updateManyPosts(data: PostUpdateManyMutationInput, where?: PostWhereInput): BatchPayload | Promise<BatchPayload>;
abstract deleteManyPosts(where?: PostWhereInput): BatchPayload | Promise<BatchPayload>;
}

export class PageInfo {
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor?: string;
endCursor?: string;
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor?: string;
endCursor?: string;
}

export class Post {
id: string;
isPublished: boolean;
title: string;
text: string;
export class Post implements Node {
id: string;
isPublished: boolean;
title: string;
text: string;
}

export class PostConnection {
pageInfo: PageInfo;
edges?: PostEdge[];
aggregate: AggregatePost;
pageInfo: PageInfo;
edges: PostEdge[];
aggregate: AggregatePost;
}

export class PostEdge {
node: Post;
cursor: string;
node: Post;
cursor: string;
}

export class PostPreviousValues {
id: string;
isPublished: boolean;
title: string;
text: string;
id: string;
isPublished: boolean;
title: string;
text: string;
}

export class PostSubscriptionPayload {
mutation: MutationType;
node?: Post;
updatedFields: string[];
previousValues?: PostPreviousValues;
mutation: MutationType;
node?: Post;
updatedFields?: string[];
previousValues?: PostPreviousValues;
}

export abstract class IQuery {
abstract posts(
where?: PostWhereInput,
orderBy?: PostOrderByInput,
skip?: number,
after?: string,
before?: string,
first?: number,
last?: number,
): Post[] | Promise<Post[]>;
abstract post(where: PostWhereUniqueInput): Post | Promise<Post>;
abstract postsConnection(
where?: PostWhereInput,
orderBy?: PostOrderByInput,
skip?: number,
after?: string,
before?: string,
first?: number,
last?: number,
): PostConnection | Promise<PostConnection>;
abstract node(id: string): Node | Promise<Node>;
abstract temp__(): boolean | Promise<boolean>;
abstract posts(where?: PostWhereInput, orderBy?: PostOrderByInput, skip?: number, after?: string, before?: string, first?: number, last?: number): Post[] | Promise<Post[]>;
abstract post(where: PostWhereUniqueInput): Post | Promise<Post>;
abstract postsConnection(where?: PostWhereInput, orderBy?: PostOrderByInput, skip?: number, after?: string, before?: string, first?: number, last?: number): PostConnection | Promise<PostConnection>;
abstract node(id: string): Node | Promise<Node>;
}

export abstract class ISubscription {
abstract post(
where?: PostSubscriptionWhereInput,
): PostSubscriptionPayload | Promise<PostSubscriptionPayload>;
abstract post(where?: PostSubscriptionWhereInput): PostSubscriptionPayload | Promise<PostSubscriptionPayload>;
}

export type Long = any;
Loading

0 comments on commit f9eebfa

Please sign in to comment.