Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into joysteam
Browse files Browse the repository at this point in the history
  • Loading branch information
metmirr committed Jun 15, 2021
2 parents 56b12d8 + 72fad57 commit 172ff42
Show file tree
Hide file tree
Showing 25 changed files with 12,208 additions and 10,686 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.13
14
13 changes: 13 additions & 0 deletions examples/02-complex-example/examples.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
query {
users(limit: 20, where: { typedJsonField_json: { params: { type_eq: "Bar" } } }) {
id
createdAt
typedJsonField {
params {
type
name
value
}
}
}
}
68 changes: 66 additions & 2 deletions examples/02-complex-example/generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export interface BaseWhereInput {
}

export interface EventObjectInput {
params: Array<EventParamInput>
params: EventParamInput
}

export interface EventParamInput {
Expand All @@ -148,6 +148,54 @@ export interface EventParamInput {
value: JSONObject
}

export interface PostCreateInput {
title: String
userId: ID_Output
}

export interface PostUpdateInput {
title?: String | null
userId?: ID_Input | null
}

export interface PostWhereInput {
id_eq?: ID_Input | null
id_in?: ID_Output[] | ID_Output | null
createdAt_eq?: DateTime | null
createdAt_lt?: DateTime | null
createdAt_lte?: DateTime | null
createdAt_gt?: DateTime | null
createdAt_gte?: DateTime | null
createdById_eq?: ID_Input | null
createdById_in?: ID_Output[] | ID_Output | null
updatedAt_eq?: DateTime | null
updatedAt_lt?: DateTime | null
updatedAt_lte?: DateTime | null
updatedAt_gt?: DateTime | null
updatedAt_gte?: DateTime | null
updatedById_eq?: ID_Input | null
updatedById_in?: ID_Output[] | ID_Output | null
deletedAt_all?: Boolean | null
deletedAt_eq?: DateTime | null
deletedAt_lt?: DateTime | null
deletedAt_lte?: DateTime | null
deletedAt_gt?: DateTime | null
deletedAt_gte?: DateTime | null
deletedById_eq?: ID_Input | null
deletedById_in?: ID_Output[] | ID_Output | null
title_eq?: String | null
title_contains?: String | null
title_startsWith?: String | null
title_endsWith?: String | null
title_in?: String[] | String | null
userId_eq?: ID_Input | null
userId_in?: ID_Output[] | ID_Output | null
}

export interface PostWhereUniqueInput {
id: ID_Output
}

export interface UserCreateInput {
booleanField?: Boolean | null
dateField?: DateTime | null
Expand Down Expand Up @@ -320,6 +368,7 @@ export interface UserWhereInput {
bigIntField_lte?: Int | null
bigIntField_in?: Int[] | Int | null
jsonField_json?: JSONObject | null
typedJsonField_json?: JSONObject | null
stringField_eq?: String | null
stringField_contains?: String | null
stringField_startsWith?: String | null
Expand Down Expand Up @@ -483,7 +532,7 @@ export interface BaseModelUUID extends BaseGraphQLObject {
}

export interface EventObject {
params: Array<EventParam>
params: EventParam
}

export interface EventParam {
Expand All @@ -499,6 +548,20 @@ export interface PageInfo {
endCursor?: String | null
}

export interface Post extends BaseGraphQLObject {
id: ID_Output
createdAt: DateTime
createdById: String
updatedAt?: DateTime | null
updatedById?: String | null
deletedAt?: DateTime | null
deletedById?: String | null
version: Int
title: String
user: User
userId: String
}

export interface StandardDeleteResponse {
id: ID_Output
}
Expand Down Expand Up @@ -553,6 +616,7 @@ export interface User extends BaseGraphQLObject {
apiOnlyField?: String | null
arrayOfStrings?: Array<String> | null
arrayOfInts?: Array<Int> | null
posts?: Array<Post> | null
}

/*
Expand Down
167 changes: 167 additions & 0 deletions examples/02-complex-example/generated/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import { EventParam } from "../src/modules/user/user.model";
import { EventObject } from "../src/modules/user/user.model";
// @ts-ignore
import { User } from "../src/modules/user/user.model";
// @ts-ignore
import { Post } from "../src/modules/post/post.model";

export enum UserOrderByEnum {
createdAt_ASC = "createdAt_ASC",
Expand Down Expand Up @@ -383,6 +385,9 @@ export class UserWhereInput {
@TypeGraphQLField(() => GraphQLJSONObject, { nullable: true })
jsonField_json?: JsonObject;

@TypeGraphQLField(() => GraphQLJSONObject, { nullable: true })
typedJsonField_json?: JsonObject;

@TypeGraphQLField({ nullable: true })
stringField_eq?: string;

Expand Down Expand Up @@ -1025,3 +1030,165 @@ export class UserUpdateArgs {
@TypeGraphQLField() data!: UserUpdateInput;
@TypeGraphQLField() where!: UserWhereUniqueInput;
}

export enum PostOrderByEnum {
createdAt_ASC = "createdAt_ASC",
createdAt_DESC = "createdAt_DESC",

updatedAt_ASC = "updatedAt_ASC",
updatedAt_DESC = "updatedAt_DESC",

deletedAt_ASC = "deletedAt_ASC",
deletedAt_DESC = "deletedAt_DESC",

title_ASC = "title_ASC",
title_DESC = "title_DESC",

userId_ASC = "userId_ASC",
userId_DESC = "userId_DESC"
}

registerEnumType(PostOrderByEnum, {
name: "PostOrderByInput"
});

@TypeGraphQLInputType()
export class PostWhereInput {
@TypeGraphQLField(() => ID, { nullable: true })
id_eq?: string;

@TypeGraphQLField(() => [ID], { nullable: true })
id_in?: string[];

@TypeGraphQLField(() => DateTime, { nullable: true })
createdAt_eq?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
createdAt_lt?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
createdAt_lte?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
createdAt_gt?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
createdAt_gte?: Date;

@TypeGraphQLField(() => ID, { nullable: true })
createdById_eq?: string;

@TypeGraphQLField(() => [ID], { nullable: true })
createdById_in?: string[];

@TypeGraphQLField(() => DateTime, { nullable: true })
updatedAt_eq?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
updatedAt_lt?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
updatedAt_lte?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
updatedAt_gt?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
updatedAt_gte?: Date;

@TypeGraphQLField(() => ID, { nullable: true })
updatedById_eq?: string;

@TypeGraphQLField(() => [ID], { nullable: true })
updatedById_in?: string[];

@TypeGraphQLField({ nullable: true })
deletedAt_all?: Boolean;

@TypeGraphQLField(() => DateTime, { nullable: true })
deletedAt_eq?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
deletedAt_lt?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
deletedAt_lte?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
deletedAt_gt?: Date;

@TypeGraphQLField(() => DateTime, { nullable: true })
deletedAt_gte?: Date;

@TypeGraphQLField(() => ID, { nullable: true })
deletedById_eq?: string;

@TypeGraphQLField(() => [ID], { nullable: true })
deletedById_in?: string[];

@TypeGraphQLField({ nullable: true })
title_eq?: string;

@TypeGraphQLField({ nullable: true })
title_contains?: string;

@TypeGraphQLField({ nullable: true })
title_startsWith?: string;

@TypeGraphQLField({ nullable: true })
title_endsWith?: string;

@TypeGraphQLField(() => [String], { nullable: true })
title_in?: string[];

@TypeGraphQLField(() => ID, { nullable: true })
userId_eq?: string;

@TypeGraphQLField(() => [ID], { nullable: true })
userId_in?: string[];
}

@TypeGraphQLInputType()
export class PostWhereUniqueInput {
@TypeGraphQLField(() => ID)
id?: string;
}

@TypeGraphQLInputType()
export class PostCreateInput {
@TypeGraphQLField()
title!: string;

@TypeGraphQLField(() => ID)
userId!: string;
}

@TypeGraphQLInputType()
export class PostUpdateInput {
@TypeGraphQLField({ nullable: true })
title?: string;

@TypeGraphQLField(() => ID, { nullable: true })
userId?: string;
}

@ArgsType()
export class PostWhereArgs extends PaginationArgs {
@TypeGraphQLField(() => PostWhereInput, { nullable: true })
where?: PostWhereInput;

@TypeGraphQLField(() => PostOrderByEnum, { nullable: true })
orderBy?: PostOrderByEnum;
}

@ArgsType()
export class PostCreateManyArgs {
@TypeGraphQLField(() => [PostCreateInput])
data!: PostCreateInput[];
}

@ArgsType()
export class PostUpdateArgs {
@TypeGraphQLField() data!: PostUpdateInput;
@TypeGraphQLField() where!: PostWhereUniqueInput;
}

0 comments on commit 172ff42

Please sign in to comment.