Skip to content

Commit

Permalink
Successfully flattened collection result
Browse files Browse the repository at this point in the history
  • Loading branch information
FOSSforlife committed Apr 17, 2020
1 parent ec3e93f commit 0a3f8f8
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 173 deletions.
14 changes: 14 additions & 0 deletions db/migrations/1587079722249-TrueRenamedReviewBody.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {MigrationInterface, QueryRunner} from "typeorm";

export class TrueRenamedReviewBody1587079722249 implements MigrationInterface {
name = 'TrueRenamedReviewBody1587079722249'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "reviews" RENAME COLUMN "review_text" TO "body"`, undefined);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "reviews" RENAME COLUMN "body" TO "review_text"`, undefined);
}

}
53 changes: 13 additions & 40 deletions generated/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,7 @@ export type CollectionItemOrderByInput = 'createdAt_ASC' |
'itemDetailsId_ASC' |
'itemDetailsId_DESC' |
'plays_ASC' |
'plays_DESC' |
'artist_ASC' |
'artist_DESC' |
'title_ASC' |
'title_DESC' |
'mbid_ASC' |
'mbid_DESC'
'plays_DESC'

export type ItemOrderByInput = 'createdAt_ASC' |
'createdAt_DESC' |
Expand Down Expand Up @@ -115,8 +109,8 @@ export type ReviewOrderByInput = 'createdAt_ASC' |
'rating_DESC' |
'title_ASC' |
'title_DESC' |
'reviewText_ASC' |
'reviewText_DESC'
'body_ASC' |
'body_DESC'

export type UserOrderByInput = 'createdAt_ASC' |
'createdAt_DESC' |
Expand Down Expand Up @@ -161,9 +155,6 @@ export interface CollectionItemCreateInput {
userId: ID_Output
itemDetailsId: ID_Output
plays?: Float | null
artist: String
title: String
mbid?: String | null
}

export interface CollectionItemUpdateInput {
Expand All @@ -172,9 +163,6 @@ export interface CollectionItemUpdateInput {
userId?: ID_Input | null
itemDetailsId?: ID_Input | null
plays?: Float | null
artist?: String | null
title?: String | null
mbid?: String | null
}

export interface CollectionItemWhereInput {
Expand Down Expand Up @@ -222,21 +210,6 @@ export interface CollectionItemWhereInput {
plays_lt?: Int | null
plays_lte?: Int | null
plays_in?: Int[] | Int | null
artist_eq?: String | null
artist_contains?: String | null
artist_startsWith?: String | null
artist_endsWith?: String | null
artist_in?: String[] | String | null
title_eq?: String | null
title_contains?: String | null
title_startsWith?: String | null
title_endsWith?: String | null
title_in?: String[] | String | null
mbid_eq?: String | null
mbid_contains?: String | null
mbid_startsWith?: String | null
mbid_endsWith?: String | null
mbid_in?: String[] | String | null
}

export interface CollectionItemWhereUniqueInput {
Expand Down Expand Up @@ -327,14 +300,14 @@ export interface ReviewCreateInput {
collectionItemId: ID_Output
rating?: String | null
title?: String | null
reviewText?: String | null
body?: String | null
}

export interface ReviewUpdateInput {
collectionItemId?: ID_Input | null
rating?: String | null
title?: String | null
reviewText?: String | null
body?: String | null
}

export interface ReviewWhereInput {
Expand Down Expand Up @@ -374,11 +347,11 @@ export interface ReviewWhereInput {
title_startsWith?: String | null
title_endsWith?: String | null
title_in?: String[] | String | null
reviewText_eq?: String | null
reviewText_contains?: String | null
reviewText_startsWith?: String | null
reviewText_endsWith?: String | null
reviewText_in?: String[] | String | null
body_eq?: String | null
body_contains?: String | null
body_startsWith?: String | null
body_endsWith?: String | null
body_in?: String[] | String | null
}

export interface ReviewWhereUniqueInput {
Expand Down Expand Up @@ -502,10 +475,10 @@ export interface CollectionItem extends BaseGraphQLObject {
itemDetails?: Item | null
itemDetailsId: String
plays?: Int | null
reviews?: Array<Review> | null
artist: String
title: String
mbid?: String | null
reviews?: Array<Review> | null
mbid: String
}

export interface Item extends BaseGraphQLObject {
Expand Down Expand Up @@ -547,7 +520,7 @@ export interface Review extends BaseGraphQLObject {
collectionItemId: String
rating?: String | null
title?: String | null
reviewText?: String | null
body?: String | null
}

export interface StandardDeleteResponse {
Expand Down
92 changes: 10 additions & 82 deletions generated/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ export enum ReviewOrderByEnum {
title_ASC = "title_ASC",
title_DESC = "title_DESC",

reviewText_ASC = "reviewText_ASC",
reviewText_DESC = "reviewText_DESC"
body_ASC = "body_ASC",
body_DESC = "body_DESC"
}

registerEnumType(ReviewOrderByEnum, {
Expand Down Expand Up @@ -651,19 +651,19 @@ export class ReviewWhereInput {
title_in?: string[];

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

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

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

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

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

@TypeGraphQLInputType()
Expand All @@ -684,7 +684,7 @@ export class ReviewCreateInput {
title?: string;

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

@TypeGraphQLInputType()
Expand All @@ -699,7 +699,7 @@ export class ReviewUpdateInput {
title?: string;

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

@ArgsType()
Expand Down Expand Up @@ -746,16 +746,7 @@ export enum CollectionItemOrderByEnum {
itemDetailsId_DESC = "itemDetailsId_DESC",

plays_ASC = "plays_ASC",
plays_DESC = "plays_DESC",

artist_ASC = "artist_ASC",
artist_DESC = "artist_DESC",

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

mbid_ASC = "mbid_ASC",
mbid_DESC = "mbid_DESC"
plays_DESC = "plays_DESC"
}

registerEnumType(CollectionItemOrderByEnum, {
Expand Down Expand Up @@ -895,51 +886,6 @@ export class CollectionItemWhereInput {

@TypeGraphQLField(() => [Int], { nullable: true })
plays_in?: number[];

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

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

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

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

@TypeGraphQLField(() => [String], { nullable: true })
artist_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({ nullable: true })
mbid_eq?: string;

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

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

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

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

@TypeGraphQLInputType()
Expand All @@ -964,15 +910,6 @@ export class CollectionItemCreateInput {

@TypeGraphQLField({ nullable: true })
plays?: number;

@TypeGraphQLField()
artist!: string;

@TypeGraphQLField()
title!: string;

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

@TypeGraphQLInputType()
Expand All @@ -991,15 +928,6 @@ export class CollectionItemUpdateInput {

@TypeGraphQLField({ nullable: true })
plays?: number;

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

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

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

@ArgsType()
Expand Down
Loading

0 comments on commit 0a3f8f8

Please sign in to comment.