From abf8cb2d51428e8302cb6d3013a9a1333fbbf149 Mon Sep 17 00:00:00 2001 From: maticzav Date: Mon, 10 Dec 2018 16:42:08 +0100 Subject: [PATCH] fix: Support nullable type declarations This commit adds support for `nullable` fields. Fixes #188 --- package.json | 4 +- src/PrismaTypescriptGenerator.test.ts.md | 394 ++++++++++----------- src/PrismaTypescriptGenerator.test.ts.snap | Bin 4676 -> 4791 bytes yarn.lock | 30 +- 4 files changed, 219 insertions(+), 209 deletions(-) diff --git a/package.json b/package.json index 079cf7d9..fa5fdae6 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "apollo-link": "1.2.4", "apollo-link-error": "1.1.2", "apollo-link-ws": "1.0.10", - "cross-fetch": "2.2.3", - "graphql-binding": "2.3.5", + "cross-fetch": "3.0.0", + "graphql-binding": "2.3.6", "graphql-import": "0.7.1", "graphql-tools": "4.0.3", "http-link-dataloader": "^0.1.6", diff --git a/src/PrismaTypescriptGenerator.test.ts.md b/src/PrismaTypescriptGenerator.test.ts.md index b4cf5733..4db8176d 100644 --- a/src/PrismaTypescriptGenerator.test.ts.md +++ b/src/PrismaTypescriptGenerator.test.ts.md @@ -14,22 +14,22 @@ Generated by [AVA](https://ava.li). import { makePrismaBindingClass, BasePrismaOptions } from 'prisma-binding'␊ ␊ export interface Query {␊ - posts: (args: { where?: PostWhereInput, orderBy?: PostOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - users: (args: { where?: UserWhereInput, orderBy?: UserOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - post: (args: { where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - user: (args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - postsConnection: (args: { where?: PostWhereInput, orderBy?: PostOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - usersConnection: (args: { where?: UserWhereInput, orderBy?: UserOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - node: (args: { id: ID_Output }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ␊ + posts: >(args: { where?: PostWhereInput | null, orderBy?: PostOrderByInput | null, skip?: Int | null, after?: String | null, before?: String | null, first?: Int | null, last?: Int | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + users: >(args: { where?: UserWhereInput | null, orderBy?: UserOrderByInput | null, skip?: Int | null, after?: String | null, before?: String | null, first?: Int | null, last?: Int | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + post: (args: { where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + user: (args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + postsConnection: (args: { where?: PostWhereInput | null, orderBy?: PostOrderByInput | null, skip?: Int | null, after?: String | null, before?: String | null, first?: Int | null, last?: Int | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + usersConnection: (args: { where?: UserWhereInput | null, orderBy?: UserOrderByInput | null, skip?: Int | null, after?: String | null, before?: String | null, first?: Int | null, last?: Int | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + node: (args: { id: ID_Output }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ␊ }␊ ␊ export interface Mutation {␊ createPost: (args: { data: PostCreateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ createUser: (args: { data: UserCreateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - updatePost: (args: { data: PostUpdateInput, where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - updateUser: (args: { data: UserUpdateInput, where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - deletePost: (args: { where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ - deleteUser: (args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + updatePost: (args: { data: PostUpdateInput, where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + updateUser: (args: { data: UserUpdateInput, where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + deletePost: (args: { where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ + deleteUser: (args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ upsertPost: (args: { where: PostWhereUniqueInput, create: PostCreateInput, update: PostUpdateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ upsertUser: (args: { where: UserWhereUniqueInput, create: UserCreateInput, update: UserUpdateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ updateManyPosts: (args: { data: PostUpdateInput, where: PostWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise ,␊ @@ -39,8 +39,8 @@ Generated by [AVA](https://ava.li). }␊ ␊ export interface Subscription {␊ - post: (args: { where?: PostSubscriptionWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise> ,␊ - user: (args: { where?: UserSubscriptionWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise> ␊ + post: (args: { where?: PostSubscriptionWhereInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise> ,␊ + user: (args: { where?: UserSubscriptionWhereInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise> ␊ }␊ ␊ export interface Exists {␊ @@ -817,53 +817,53 @@ Generated by [AVA](https://ava.li). 'createdAt_DESC'␊ ␊ export interface PostCreateInput {␊ - isPublished?: Boolean␊ + isPublished?: Boolean | null␊ title: String␊ text: String␊ author: UserCreateOneWithoutPostsInput␊ }␊ ␊ export interface PostCreateManyWithoutAuthorInput {␊ - create?: PostCreateWithoutAuthorInput[] | PostCreateWithoutAuthorInput␊ - connect?: PostWhereUniqueInput[] | PostWhereUniqueInput␊ + create?: PostCreateWithoutAuthorInput[] | PostCreateWithoutAuthorInput | null␊ + connect?: PostWhereUniqueInput[] | PostWhereUniqueInput | null␊ }␊ ␊ export interface PostCreateWithoutAuthorInput {␊ - isPublished?: Boolean␊ + isPublished?: Boolean | null␊ title: String␊ text: String␊ }␊ ␊ export interface PostSubscriptionWhereInput {␊ - AND?: PostSubscriptionWhereInput[] | PostSubscriptionWhereInput␊ - OR?: PostSubscriptionWhereInput[] | PostSubscriptionWhereInput␊ - mutation_in?: MutationType[] | MutationType␊ - updatedFields_contains?: String␊ - updatedFields_contains_every?: String[] | String␊ - updatedFields_contains_some?: String[] | String␊ - node?: PostWhereInput␊ + AND?: PostSubscriptionWhereInput[] | PostSubscriptionWhereInput | null␊ + OR?: PostSubscriptionWhereInput[] | PostSubscriptionWhereInput | null␊ + mutation_in?: MutationType[] | MutationType | null␊ + updatedFields_contains?: String | null␊ + updatedFields_contains_every?: String[] | String | null␊ + updatedFields_contains_some?: String[] | String | null␊ + node?: PostWhereInput | null␊ }␊ ␊ export interface PostUpdateInput {␊ - isPublished?: Boolean␊ - title?: String␊ - text?: String␊ - author?: UserUpdateOneWithoutPostsInput␊ + isPublished?: Boolean | null␊ + title?: String | null␊ + text?: String | null␊ + author?: UserUpdateOneWithoutPostsInput | null␊ }␊ ␊ export interface PostUpdateManyWithoutAuthorInput {␊ - create?: PostCreateWithoutAuthorInput[] | PostCreateWithoutAuthorInput␊ - connect?: PostWhereUniqueInput[] | PostWhereUniqueInput␊ - disconnect?: PostWhereUniqueInput[] | PostWhereUniqueInput␊ - delete?: PostWhereUniqueInput[] | PostWhereUniqueInput␊ - update?: PostUpdateWithWhereUniqueWithoutAuthorInput[] | PostUpdateWithWhereUniqueWithoutAuthorInput␊ - upsert?: PostUpsertWithWhereUniqueWithoutAuthorInput[] | PostUpsertWithWhereUniqueWithoutAuthorInput␊ + create?: PostCreateWithoutAuthorInput[] | PostCreateWithoutAuthorInput | null␊ + connect?: PostWhereUniqueInput[] | PostWhereUniqueInput | null␊ + disconnect?: PostWhereUniqueInput[] | PostWhereUniqueInput | null␊ + delete?: PostWhereUniqueInput[] | PostWhereUniqueInput | null␊ + update?: PostUpdateWithWhereUniqueWithoutAuthorInput[] | PostUpdateWithWhereUniqueWithoutAuthorInput | null␊ + upsert?: PostUpsertWithWhereUniqueWithoutAuthorInput[] | PostUpsertWithWhereUniqueWithoutAuthorInput | null␊ }␊ ␊ export interface PostUpdateWithoutAuthorDataInput {␊ - isPublished?: Boolean␊ - title?: String␊ - text?: String␊ + isPublished?: Boolean | null␊ + title?: String | null␊ + text?: String | null␊ }␊ ␊ export interface PostUpdateWithWhereUniqueWithoutAuthorInput {␊ @@ -878,85 +878,85 @@ Generated by [AVA](https://ava.li). }␊ ␊ export interface PostWhereInput {␊ - AND?: PostWhereInput[] | PostWhereInput␊ - OR?: PostWhereInput[] | PostWhereInput␊ - id?: ID_Input␊ - id_not?: ID_Input␊ - id_in?: ID_Input[] | ID_Input␊ - id_not_in?: ID_Input[] | ID_Input␊ - id_lt?: ID_Input␊ - id_lte?: ID_Input␊ - id_gt?: ID_Input␊ - id_gte?: ID_Input␊ - id_contains?: ID_Input␊ - id_not_contains?: ID_Input␊ - id_starts_with?: ID_Input␊ - id_not_starts_with?: ID_Input␊ - id_ends_with?: ID_Input␊ - id_not_ends_with?: ID_Input␊ - createdAt?: DateTime␊ - createdAt_not?: DateTime␊ - createdAt_in?: DateTime[] | DateTime␊ - createdAt_not_in?: DateTime[] | DateTime␊ - createdAt_lt?: DateTime␊ - createdAt_lte?: DateTime␊ - createdAt_gt?: DateTime␊ - createdAt_gte?: DateTime␊ - updatedAt?: DateTime␊ - updatedAt_not?: DateTime␊ - updatedAt_in?: DateTime[] | DateTime␊ - updatedAt_not_in?: DateTime[] | DateTime␊ - updatedAt_lt?: DateTime␊ - updatedAt_lte?: DateTime␊ - updatedAt_gt?: DateTime␊ - updatedAt_gte?: DateTime␊ - isPublished?: Boolean␊ - isPublished_not?: Boolean␊ - title?: String␊ - title_not?: String␊ - title_in?: String[] | String␊ - title_not_in?: String[] | 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[] | String␊ - text_not_in?: String[] | 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␊ - author?: UserWhereInput␊ + AND?: PostWhereInput[] | PostWhereInput | null␊ + OR?: PostWhereInput[] | PostWhereInput | null␊ + id?: ID_Input | null␊ + id_not?: ID_Input | null␊ + id_in?: ID_Output[] | ID_Output | null␊ + id_not_in?: ID_Output[] | ID_Output | null␊ + id_lt?: ID_Input | null␊ + id_lte?: ID_Input | null␊ + id_gt?: ID_Input | null␊ + id_gte?: ID_Input | null␊ + id_contains?: ID_Input | null␊ + id_not_contains?: ID_Input | null␊ + id_starts_with?: ID_Input | null␊ + id_not_starts_with?: ID_Input | null␊ + id_ends_with?: ID_Input | null␊ + id_not_ends_with?: ID_Input | null␊ + createdAt?: DateTime | null␊ + createdAt_not?: DateTime | null␊ + createdAt_in?: DateTime[] | DateTime | null␊ + createdAt_not_in?: DateTime[] | DateTime | null␊ + createdAt_lt?: DateTime | null␊ + createdAt_lte?: DateTime | null␊ + createdAt_gt?: DateTime | null␊ + createdAt_gte?: DateTime | null␊ + updatedAt?: DateTime | null␊ + updatedAt_not?: DateTime | null␊ + updatedAt_in?: DateTime[] | DateTime | null␊ + updatedAt_not_in?: DateTime[] | DateTime | null␊ + updatedAt_lt?: DateTime | null␊ + updatedAt_lte?: DateTime | null␊ + updatedAt_gt?: DateTime | null␊ + updatedAt_gte?: DateTime | null␊ + isPublished?: Boolean | null␊ + isPublished_not?: Boolean | null␊ + title?: String | null␊ + title_not?: String | null␊ + title_in?: String[] | String | null␊ + title_not_in?: String[] | String | null␊ + title_lt?: String | null␊ + title_lte?: String | null␊ + title_gt?: String | null␊ + title_gte?: String | null␊ + title_contains?: String | null␊ + title_not_contains?: String | null␊ + title_starts_with?: String | null␊ + title_not_starts_with?: String | null␊ + title_ends_with?: String | null␊ + title_not_ends_with?: String | null␊ + text?: String | null␊ + text_not?: String | null␊ + text_in?: String[] | String | null␊ + text_not_in?: String[] | String | null␊ + text_lt?: String | null␊ + text_lte?: String | null␊ + text_gt?: String | null␊ + text_gte?: String | null␊ + text_contains?: String | null␊ + text_not_contains?: String | null␊ + text_starts_with?: String | null␊ + text_not_starts_with?: String | null␊ + text_ends_with?: String | null␊ + text_not_ends_with?: String | null␊ + author?: UserWhereInput | null␊ }␊ ␊ export interface PostWhereUniqueInput {␊ - id?: ID_Input␊ + id?: ID_Input | null␊ }␊ ␊ export interface UserCreateInput {␊ email: String␊ password: String␊ name: String␊ - posts?: PostCreateManyWithoutAuthorInput␊ + posts?: PostCreateManyWithoutAuthorInput | null␊ }␊ ␊ export interface UserCreateOneWithoutPostsInput {␊ - create?: UserCreateWithoutPostsInput␊ - connect?: UserWhereUniqueInput␊ + create?: UserCreateWithoutPostsInput | null␊ + connect?: UserWhereUniqueInput | null␊ }␊ ␊ export interface UserCreateWithoutPostsInput {␊ @@ -966,34 +966,34 @@ Generated by [AVA](https://ava.li). }␊ ␊ export interface UserSubscriptionWhereInput {␊ - AND?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput␊ - OR?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput␊ - mutation_in?: MutationType[] | MutationType␊ - updatedFields_contains?: String␊ - updatedFields_contains_every?: String[] | String␊ - updatedFields_contains_some?: String[] | String␊ - node?: UserWhereInput␊ + AND?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput | null␊ + OR?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput | null␊ + mutation_in?: MutationType[] | MutationType | null␊ + updatedFields_contains?: String | null␊ + updatedFields_contains_every?: String[] | String | null␊ + updatedFields_contains_some?: String[] | String | null␊ + node?: UserWhereInput | null␊ }␊ ␊ export interface UserUpdateInput {␊ - email?: String␊ - password?: String␊ - name?: String␊ - posts?: PostUpdateManyWithoutAuthorInput␊ + email?: String | null␊ + password?: String | null␊ + name?: String | null␊ + posts?: PostUpdateManyWithoutAuthorInput | null␊ }␊ ␊ export interface UserUpdateOneWithoutPostsInput {␊ - create?: UserCreateWithoutPostsInput␊ - connect?: UserWhereUniqueInput␊ - delete?: Boolean␊ - update?: UserUpdateWithoutPostsDataInput␊ - upsert?: UserUpsertWithoutPostsInput␊ + create?: UserCreateWithoutPostsInput | null␊ + connect?: UserWhereUniqueInput | null␊ + delete?: Boolean | null␊ + update?: UserUpdateWithoutPostsDataInput | null␊ + upsert?: UserUpsertWithoutPostsInput | null␊ }␊ ␊ export interface UserUpdateWithoutPostsDataInput {␊ - email?: String␊ - password?: String␊ - name?: String␊ + email?: String | null␊ + password?: String | null␊ + name?: String | null␊ }␊ ␊ export interface UserUpsertWithoutPostsInput {␊ @@ -1002,72 +1002,72 @@ Generated by [AVA](https://ava.li). }␊ ␊ export interface UserWhereInput {␊ - AND?: UserWhereInput[] | UserWhereInput␊ - OR?: UserWhereInput[] | UserWhereInput␊ - id?: ID_Input␊ - id_not?: ID_Input␊ - id_in?: ID_Input[] | ID_Input␊ - id_not_in?: ID_Input[] | ID_Input␊ - id_lt?: ID_Input␊ - id_lte?: ID_Input␊ - id_gt?: ID_Input␊ - id_gte?: ID_Input␊ - id_contains?: ID_Input␊ - id_not_contains?: ID_Input␊ - id_starts_with?: ID_Input␊ - id_not_starts_with?: ID_Input␊ - id_ends_with?: ID_Input␊ - id_not_ends_with?: ID_Input␊ - email?: String␊ - email_not?: String␊ - email_in?: String[] | String␊ - email_not_in?: String[] | String␊ - email_lt?: String␊ - email_lte?: String␊ - email_gt?: String␊ - email_gte?: String␊ - email_contains?: String␊ - email_not_contains?: String␊ - email_starts_with?: String␊ - email_not_starts_with?: String␊ - email_ends_with?: String␊ - email_not_ends_with?: String␊ - password?: String␊ - password_not?: String␊ - password_in?: String[] | String␊ - password_not_in?: String[] | String␊ - password_lt?: String␊ - password_lte?: String␊ - password_gt?: String␊ - password_gte?: String␊ - password_contains?: String␊ - password_not_contains?: String␊ - password_starts_with?: String␊ - password_not_starts_with?: String␊ - password_ends_with?: String␊ - password_not_ends_with?: String␊ - name?: String␊ - name_not?: String␊ - name_in?: String[] | String␊ - name_not_in?: String[] | String␊ - name_lt?: String␊ - name_lte?: String␊ - name_gt?: String␊ - name_gte?: String␊ - name_contains?: String␊ - name_not_contains?: String␊ - name_starts_with?: String␊ - name_not_starts_with?: String␊ - name_ends_with?: String␊ - name_not_ends_with?: String␊ - posts_every?: PostWhereInput␊ - posts_some?: PostWhereInput␊ - posts_none?: PostWhereInput␊ + AND?: UserWhereInput[] | UserWhereInput | null␊ + OR?: UserWhereInput[] | UserWhereInput | null␊ + id?: ID_Input | null␊ + id_not?: ID_Input | null␊ + id_in?: ID_Output[] | ID_Output | null␊ + id_not_in?: ID_Output[] | ID_Output | null␊ + id_lt?: ID_Input | null␊ + id_lte?: ID_Input | null␊ + id_gt?: ID_Input | null␊ + id_gte?: ID_Input | null␊ + id_contains?: ID_Input | null␊ + id_not_contains?: ID_Input | null␊ + id_starts_with?: ID_Input | null␊ + id_not_starts_with?: ID_Input | null␊ + id_ends_with?: ID_Input | null␊ + id_not_ends_with?: ID_Input | null␊ + email?: String | null␊ + email_not?: String | null␊ + email_in?: String[] | String | null␊ + email_not_in?: String[] | String | null␊ + email_lt?: String | null␊ + email_lte?: String | null␊ + email_gt?: String | null␊ + email_gte?: String | null␊ + email_contains?: String | null␊ + email_not_contains?: String | null␊ + email_starts_with?: String | null␊ + email_not_starts_with?: String | null␊ + email_ends_with?: String | null␊ + email_not_ends_with?: String | null␊ + password?: String | null␊ + password_not?: String | null␊ + password_in?: String[] | String | null␊ + password_not_in?: String[] | String | null␊ + password_lt?: String | null␊ + password_lte?: String | null␊ + password_gt?: String | null␊ + password_gte?: String | null␊ + password_contains?: String | null␊ + password_not_contains?: String | null␊ + password_starts_with?: String | null␊ + password_not_starts_with?: String | null␊ + password_ends_with?: String | null␊ + password_not_ends_with?: String | null␊ + name?: String | null␊ + name_not?: String | null␊ + name_in?: String[] | String | null␊ + name_not_in?: String[] | String | null␊ + name_lt?: String | null␊ + name_lte?: String | null␊ + name_gt?: String | null␊ + name_gte?: String | null␊ + name_contains?: String | null␊ + name_not_contains?: String | null␊ + name_starts_with?: String | null␊ + name_not_starts_with?: String | null␊ + name_ends_with?: String | null␊ + name_not_ends_with?: String | null␊ + posts_every?: PostWhereInput | null␊ + posts_some?: PostWhereInput | null␊ + posts_none?: PostWhereInput | null␊ }␊ ␊ export interface UserWhereUniqueInput {␊ - id?: ID_Input␊ - email?: String␊ + id?: ID_Input | null␊ + email?: String | null␊ }␊ ␊ /*␊ @@ -1097,8 +1097,8 @@ Generated by [AVA](https://ava.li). export interface PageInfo {␊ hasNextPage: Boolean␊ hasPreviousPage: Boolean␊ - startCursor?: String␊ - endCursor?: String␊ + startCursor?: String | null␊ + endCursor?: String | null␊ }␊ ␊ export interface Post extends Node {␊ @@ -1117,7 +1117,7 @@ Generated by [AVA](https://ava.li). */␊ export interface PostConnection {␊ pageInfo: PageInfo␊ - edges: PostEdge[]␊ + edges: Array␊ aggregate: AggregatePost␊ }␊ ␊ @@ -1141,9 +1141,9 @@ Generated by [AVA](https://ava.li). ␊ export interface PostSubscriptionPayload {␊ mutation: MutationType␊ - node?: Post␊ - updatedFields?: String[]␊ - previousValues?: PostPreviousValues␊ + node?: Post | null␊ + updatedFields?: Array | null␊ + previousValues?: PostPreviousValues | null␊ }␊ ␊ export interface User extends Node {␊ @@ -1151,7 +1151,7 @@ Generated by [AVA](https://ava.li). email: String␊ password: String␊ name: String␊ - posts?: Post[]␊ + posts?: Array | null␊ }␊ ␊ /*␊ @@ -1160,7 +1160,7 @@ Generated by [AVA](https://ava.li). */␊ export interface UserConnection {␊ pageInfo: PageInfo␊ - edges: UserEdge[]␊ + edges: Array␊ aggregate: AggregateUser␊ }␊ ␊ @@ -1182,9 +1182,9 @@ Generated by [AVA](https://ava.li). ␊ export interface UserSubscriptionPayload {␊ mutation: MutationType␊ - node?: User␊ - updatedFields?: String[]␊ - previousValues?: UserPreviousValues␊ + node?: User | null␊ + updatedFields?: Array | null␊ + previousValues?: UserPreviousValues | null␊ }␊ ␊ /*␊ diff --git a/src/PrismaTypescriptGenerator.test.ts.snap b/src/PrismaTypescriptGenerator.test.ts.snap index 245aaf43cd91a357968a9a47a98ed6816f767446..e0b2596d3dd9f6d00dad4d70a7a8b4bbe27d1200 100644 GIT binary patch literal 4791 zcmV;o5=iYqRzV%TiJY3Rt?SO5Tx+s+^OZDZc$K-$_*66H%+G+d#LPvdrr{ldNv;oD>bMF48fr zjjE3qO;#4&dgoa&$%?4~IZt2F(<-ay=>uN&Fi-1xmpn*o@xF~~!QN_A3H_eo$|ND= zt0k>2$=ig$-=eIWdXLyFMuR?_oS(SRQ39tUX-k{*87XBs+$%H z;D-H*yxWDYUX<{%D_nr78BU;>vkkxm1882lYp=$5b4fFNWGYE3)sFf;q!bBAYY>CI~Vm)h0;E>BO}<<SN-yb8ESPrW&t32H3PK45?$TyFy_)synz5 zA?aQ_4zN;_-ZFDddP|S5#Qwibi_23ZztktL2YpOn$OFug6ukFvjIppl(74n%%xigqkLNC*m5WJBRgUF+PDV zq)l0AKjsPSSLr|-{<=Hhk<#(^8E7+;5BJX_cl2*Ha$c4>O^bb~#69E49SplGxyazl z2#k#HaAjbRFA%`bxd`p{RFDTRYlD${mZm`=WnJ16U4s`D1)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c)|sd;Qa8Te3Z9FETdWno~2)%SX+iy`k^gVW+=p*XPw1B92d1)=)=i za!5mE0IOF+8)kDo4K>1Jji|~F8XAlXU0&i{mOHMaajr1Y7L9YqiGqYNQtwn)j`y=M zr&Y0_r+8rP^gK>WdU`*qWzRoLOwpK?*Y{;?C*JNkI90)uc05{ zcXFQ4ViT0I!tlS6j!{z!dX9G`Xg4JQuW?D<&`TEI44M;V^H7jd|T?luQ@1INJihHO8+~-6!lL z572)8X`h(g;J^=IVa1#HktQJkGAI|wH^}(T7k5tYBHsu;0n4wmzJLr~o*g%X(MOtM zz42&7=XDkPdse^5K@A9ARQN%BlBh{0KIr<$?wPFW<9kBv8?~*U6Z-r!`8lD_KVzR0 zB36qsWKy(2F^MCYAM~q74K5jsElaLaUPkdfg$F`$e|fXc;2r$x=&P;YlhHKBmVkPc z__?%fgrY@k4$UD!OJ_Or+{#GKF6Ae=xV^~6ofnjD;kd7%#EciKS)vlzu>S$?qGJXk GegFU%=oWzh diff --git a/yarn.lock b/yarn.lock index 5eeccdc8..2253e196 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1621,13 +1621,13 @@ cross-fetch@2.2.2: node-fetch "2.1.2" whatwg-fetch "2.0.4" -cross-fetch@2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" - integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== +cross-fetch@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.0.tgz#fb7fa6906f39c7233aa7ab8de1785e980532b899" + integrity sha512-P8HyKlMwT1ed9LqEWlJu+zfcxfn0KI4Nl4nxyvu1a8sg4vgtHdwhElZOgSNzoar44zQMdliZcve4QG/04AUi9Q== dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" + node-fetch "2.3.0" + whatwg-fetch "3.0.0" cross-spawn@^5.0.1: version "5.1.0" @@ -2552,10 +2552,10 @@ graceful-fs@~4.1.11: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== -graphql-binding@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/graphql-binding/-/graphql-binding-2.3.5.tgz#b3a7ee91f82f94f044c9902b08f888ef4bf0c6a9" - integrity sha512-COtcQzRIJU3MLJ+NOiVtN0UrLS/ZknZRbAqPIRmK4oAQlvBhY4M903m6RoS4kRW1uk/aFuQyEqyj4lbzHoLjfw== +graphql-binding@2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/graphql-binding/-/graphql-binding-2.3.6.tgz#37546f038567d56ea4f3ee3ec9e6629d078d9545" + integrity sha512-khQsAuGjAceZB8oLBIIIo7eomrqwICmxiDvaMz0bIhEUsyBr109CauFamkSBXxQKh71uf5e8MihCsW50gLfQEQ== dependencies: graphql-import "^0.7.1" graphql-tools "4.0.3" @@ -4102,6 +4102,11 @@ node-fetch@2.1.2, node-fetch@^2.1.1: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= +node-fetch@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" + integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== + node-gyp@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" @@ -6422,6 +6427,11 @@ whatwg-fetch@2.0.4: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== +whatwg-fetch@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"