diff --git a/database/datamodel.graphql b/database/datamodel.graphql index 84359a2..1c2149c 100644 --- a/database/datamodel.graphql +++ b/database/datamodel.graphql @@ -3,8 +3,8 @@ type Post { createdAt: DateTime! updatedAt: DateTime! isPublished: Boolean! @default(value: "false") - slug: String @unique title: String! @unique + normalizeTitle: String! @unique text: String! author: User! votes: [Vote!]! @@ -17,6 +17,7 @@ type Category { createdAt: DateTime! updatedAt: DateTime! title: String! @unique + normalizeTitle: String! @unique subCategories: [SubCategory!]! } @@ -25,6 +26,7 @@ type SubCategory { createdAt: DateTime! updatedAt: DateTime! title: String! @unique + normalizeTitle: String! @unique categories: [Category!]! posts: [Post!]! } diff --git a/src/generated/graphqlgen.ts b/src/generated/graphqlgen.ts index 2ea4b97..73cc34f 100644 --- a/src/generated/graphqlgen.ts +++ b/src/generated/graphqlgen.ts @@ -9,7 +9,7 @@ import { Category, AppState, } from './prisma-client' -import { VoteSummary, AuthPayload, Context } from '../utils' +import { VoteSummary, SearchResults, AuthPayload, Context } from '../utils' export type UserRole = 'MEMBER' | 'EDITOR' | 'ADMIN' export type VoteType = 'LIKE' | 'DISLIKE' @@ -31,6 +31,8 @@ export type SubCategoryOrderByInput = | 'updatedAt_DESC' | 'title_ASC' | 'title_DESC' + | 'normalizeTitle_ASC' + | 'normalizeTitle_DESC' export type CategoryOrderByInput = | 'id_ASC' | 'id_DESC' @@ -40,6 +42,8 @@ export type CategoryOrderByInput = | 'updatedAt_DESC' | 'title_ASC' | 'title_DESC' + | 'normalizeTitle_ASC' + | 'normalizeTitle_DESC' export type PostOrderByInput = | 'id_ASC' | 'id_DESC' @@ -49,10 +53,10 @@ export type PostOrderByInput = | 'updatedAt_DESC' | 'isPublished_ASC' | 'isPublished_DESC' - | 'slug_ASC' - | 'slug_DESC' | 'title_ASC' | 'title_DESC' + | 'normalizeTitle_ASC' + | 'normalizeTitle_DESC' | 'text_ASC' | 'text_DESC' | 'thumbnail_ASC' @@ -94,20 +98,6 @@ export namespace QueryResolvers { updatedAt_gte?: string | null isPublished?: boolean | null isPublished_not?: boolean | null - slug?: string | null - slug_not?: string | null - slug_in?: string[] | null - slug_not_in?: string[] | null - slug_lt?: string | null - slug_lte?: string | null - slug_gt?: string | null - slug_gte?: string | null - slug_contains?: string | null - slug_not_contains?: string | null - slug_starts_with?: string | null - slug_not_starts_with?: string | null - slug_ends_with?: string | null - slug_not_ends_with?: string | null title?: string | null title_not?: string | null title_in?: string[] | null @@ -122,6 +112,20 @@ export namespace QueryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null text?: string | null text_not?: string | null text_in?: string[] | null @@ -372,6 +376,20 @@ export namespace QueryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null categories_every?: CategoryWhereInput | null categories_some?: CategoryWhereInput | null categories_none?: CategoryWhereInput | null @@ -427,6 +445,20 @@ export namespace QueryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null subCategories_every?: SubCategoryWhereInput | null subCategories_some?: SubCategoryWhereInput | null subCategories_none?: SubCategoryWhereInput | null @@ -449,7 +481,7 @@ export namespace QueryResolvers { last?: number | null } - export interface ArgsSearchCategories { + export interface ArgsSearch { value: string } @@ -479,7 +511,7 @@ export namespace QueryResolvers { args: ArgsPosts, ctx: Context, info: GraphQLResolveInfo, - ) => Array | Promise> + ) => Post[] | Promise export type WelcomePostResolver = ( parent: undefined, @@ -488,12 +520,19 @@ export namespace QueryResolvers { info: GraphQLResolveInfo, ) => Post | null | Promise - export type SearchCategoriesResolver = ( + export type SubCategoriesResolver = ( + parent: undefined, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => SubCategory[] | Promise + + export type SearchResolver = ( parent: undefined, - args: ArgsSearchCategories, + args: ArgsSearch, ctx: Context, info: GraphQLResolveInfo, - ) => Category[] | Promise + ) => SearchResults | null | Promise export type AppStateResolver = ( parent: undefined, @@ -536,7 +575,7 @@ export namespace QueryResolvers { args: ArgsPosts, ctx: Context, info: GraphQLResolveInfo, - ) => Array | Promise> + ) => Post[] | Promise welcomePost: ( parent: undefined, @@ -545,12 +584,19 @@ export namespace QueryResolvers { info: GraphQLResolveInfo, ) => Post | null | Promise - searchCategories: ( + subCategories: ( parent: undefined, - args: ArgsSearchCategories, + args: {}, ctx: Context, info: GraphQLResolveInfo, - ) => Category[] | Promise + ) => SubCategory[] | Promise + + search: ( + parent: undefined, + args: ArgsSearch, + ctx: Context, + info: GraphQLResolveInfo, + ) => SearchResults | null | Promise appState: ( parent: undefined, @@ -574,7 +620,6 @@ export namespace PostResolvers { createdAt: (parent: Post) => parent.createdAt, updatedAt: (parent: Post) => parent.updatedAt, isPublished: (parent: Post) => parent.isPublished, - slug: (parent: Post) => (parent.slug === undefined ? null : parent.slug), title: (parent: Post) => parent.title, text: (parent: Post) => parent.text, thumbnail: (parent: Post) => @@ -667,6 +712,20 @@ export namespace PostResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null categories_every?: CategoryWhereInput | null categories_some?: CategoryWhereInput | null categories_none?: CategoryWhereInput | null @@ -835,20 +894,6 @@ export namespace PostResolvers { updatedAt_gte?: string | null isPublished?: boolean | null isPublished_not?: boolean | null - slug?: string | null - slug_not?: string | null - slug_in?: string[] | null - slug_not_in?: string[] | null - slug_lt?: string | null - slug_lte?: string | null - slug_gt?: string | null - slug_gte?: string | null - slug_contains?: string | null - slug_not_contains?: string | null - slug_starts_with?: string | null - slug_not_starts_with?: string | null - slug_ends_with?: string | null - slug_not_ends_with?: string | null title?: string | null title_not?: string | null title_in?: string[] | null @@ -863,6 +908,20 @@ export namespace PostResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null text?: string | null text_not?: string | null text_in?: string[] | null @@ -947,6 +1006,20 @@ export namespace PostResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null subCategories_every?: SubCategoryWhereInput | null subCategories_some?: SubCategoryWhereInput | null subCategories_none?: SubCategoryWhereInput | null @@ -1003,13 +1076,6 @@ export namespace PostResolvers { info: GraphQLResolveInfo, ) => boolean | Promise - export type SlugResolver = ( - parent: Post, - args: {}, - ctx: Context, - info: GraphQLResolveInfo, - ) => string | null | Promise - export type TitleResolver = ( parent: Post, args: {}, @@ -1088,13 +1154,6 @@ export namespace PostResolvers { info: GraphQLResolveInfo, ) => boolean | Promise - slug: ( - parent: Post, - args: {}, - ctx: Context, - info: GraphQLResolveInfo, - ) => string | null | Promise - title: ( parent: Post, args: {}, @@ -1342,6 +1401,7 @@ export namespace SubCategoryResolvers { createdAt: (parent: SubCategory) => parent.createdAt, updatedAt: (parent: SubCategory) => parent.updatedAt, title: (parent: SubCategory) => parent.title, + normalizeTitle: (parent: SubCategory) => parent.normalizeTitle, } export interface CategoryWhereInput { @@ -1389,6 +1449,20 @@ export namespace SubCategoryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null subCategories_every?: SubCategoryWhereInput | null subCategories_some?: SubCategoryWhereInput | null subCategories_none?: SubCategoryWhereInput | null @@ -1429,20 +1503,6 @@ export namespace SubCategoryResolvers { updatedAt_gte?: string | null isPublished?: boolean | null isPublished_not?: boolean | null - slug?: string | null - slug_not?: string | null - slug_in?: string[] | null - slug_not_in?: string[] | null - slug_lt?: string | null - slug_lte?: string | null - slug_gt?: string | null - slug_gte?: string | null - slug_contains?: string | null - slug_not_contains?: string | null - slug_starts_with?: string | null - slug_not_starts_with?: string | null - slug_ends_with?: string | null - slug_not_ends_with?: string | null title?: string | null title_not?: string | null title_in?: string[] | null @@ -1457,6 +1517,20 @@ export namespace SubCategoryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null text?: string | null text_not?: string | null text_in?: string[] | null @@ -1541,6 +1615,20 @@ export namespace SubCategoryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null categories_every?: CategoryWhereInput | null categories_some?: CategoryWhereInput | null categories_none?: CategoryWhereInput | null @@ -1766,6 +1854,13 @@ export namespace SubCategoryResolvers { info: GraphQLResolveInfo, ) => string | Promise + export type NormalizeTitleResolver = ( + parent: SubCategory, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => string | Promise + export type CategoriesResolver = ( parent: SubCategory, args: ArgsCategories, @@ -1809,6 +1904,13 @@ export namespace SubCategoryResolvers { info: GraphQLResolveInfo, ) => string | Promise + normalizeTitle: ( + parent: SubCategory, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => string | Promise + categories: ( parent: SubCategory, args: ArgsCategories, @@ -1831,6 +1933,7 @@ export namespace CategoryResolvers { createdAt: (parent: Category) => parent.createdAt, updatedAt: (parent: Category) => parent.updatedAt, title: (parent: Category) => parent.title, + normalizeTitle: (parent: Category) => parent.normalizeTitle, } export interface SubCategoryWhereInput { @@ -1878,6 +1981,20 @@ export namespace CategoryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null categories_every?: CategoryWhereInput | null categories_some?: CategoryWhereInput | null categories_none?: CategoryWhereInput | null @@ -1933,6 +2050,20 @@ export namespace CategoryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null subCategories_every?: SubCategoryWhereInput | null subCategories_some?: SubCategoryWhereInput | null subCategories_none?: SubCategoryWhereInput | null @@ -1973,20 +2104,6 @@ export namespace CategoryResolvers { updatedAt_gte?: string | null isPublished?: boolean | null isPublished_not?: boolean | null - slug?: string | null - slug_not?: string | null - slug_in?: string[] | null - slug_not_in?: string[] | null - slug_lt?: string | null - slug_lte?: string | null - slug_gt?: string | null - slug_gte?: string | null - slug_contains?: string | null - slug_not_contains?: string | null - slug_starts_with?: string | null - slug_not_starts_with?: string | null - slug_ends_with?: string | null - slug_not_ends_with?: string | null title?: string | null title_not?: string | null title_in?: string[] | null @@ -2001,6 +2118,20 @@ export namespace CategoryResolvers { title_not_starts_with?: string | null title_ends_with?: string | null title_not_ends_with?: string | null + normalizeTitle?: string | null + normalizeTitle_not?: string | null + normalizeTitle_in?: string[] | null + normalizeTitle_not_in?: string[] | null + normalizeTitle_lt?: string | null + normalizeTitle_lte?: string | null + normalizeTitle_gt?: string | null + normalizeTitle_gte?: string | null + normalizeTitle_contains?: string | null + normalizeTitle_not_contains?: string | null + normalizeTitle_starts_with?: string | null + normalizeTitle_not_starts_with?: string | null + normalizeTitle_ends_with?: string | null + normalizeTitle_not_ends_with?: string | null text?: string | null text_not?: string | null text_in?: string[] | null @@ -2245,6 +2376,13 @@ export namespace CategoryResolvers { info: GraphQLResolveInfo, ) => string | Promise + export type NormalizeTitleResolver = ( + parent: Category, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => string | Promise + export type SubCategoriesResolver = ( parent: Category, args: ArgsSubCategories, @@ -2281,6 +2419,13 @@ export namespace CategoryResolvers { info: GraphQLResolveInfo, ) => string | Promise + normalizeTitle: ( + parent: Category, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => string | Promise + subCategories: ( parent: Category, args: ArgsSubCategories, @@ -2329,6 +2474,54 @@ export namespace VoteSummaryResolvers { } } +export namespace SearchResultsResolvers { + export const defaultResolvers = {} + + export type PostsResolver = ( + parent: SearchResults, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => Array | Promise> + + export type SubCategoriesResolver = ( + parent: SearchResults, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => Array | Promise> + + export type CategoriesResolver = ( + parent: SearchResults, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => Array | Promise> + + export interface Type { + posts: ( + parent: SearchResults, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => Array | Promise> + + subCategories: ( + parent: SearchResults, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => Array | Promise> + + categories: ( + parent: SearchResults, + args: {}, + ctx: Context, + info: GraphQLResolveInfo, + ) => Array | Promise> + } +} + export namespace AppStateResolvers { export const defaultResolvers = { id: (parent: AppState) => parent.id, @@ -2659,6 +2852,7 @@ export interface Resolvers { SubCategory: SubCategoryResolvers.Type Category: CategoryResolvers.Type VoteSummary: VoteSummaryResolvers.Type + SearchResults: SearchResultsResolvers.Type AppState: AppStateResolvers.Type Mutation: MutationResolvers.Type AuthPayload: AuthPayloadResolvers.Type diff --git a/src/generated/prisma-client/index.ts b/src/generated/prisma-client/index.ts index 29febd3..4e5fd63 100644 --- a/src/generated/prisma-client/index.ts +++ b/src/generated/prisma-client/index.ts @@ -335,7 +335,9 @@ export type SubCategoryOrderByInput = | "updatedAt_ASC" | "updatedAt_DESC" | "title_ASC" - | "title_DESC"; + | "title_DESC" + | "normalizeTitle_ASC" + | "normalizeTitle_DESC"; export type CategoryOrderByInput = | "id_ASC" @@ -345,7 +347,9 @@ export type CategoryOrderByInput = | "updatedAt_ASC" | "updatedAt_DESC" | "title_ASC" - | "title_DESC"; + | "title_DESC" + | "normalizeTitle_ASC" + | "normalizeTitle_DESC"; export type PostOrderByInput = | "id_ASC" @@ -356,10 +360,10 @@ export type PostOrderByInput = | "updatedAt_DESC" | "isPublished_ASC" | "isPublished_DESC" - | "slug_ASC" - | "slug_DESC" | "title_ASC" | "title_DESC" + | "normalizeTitle_ASC" + | "normalizeTitle_DESC" | "text_ASC" | "text_DESC" | "thumbnail_ASC" @@ -464,8 +468,8 @@ export interface UserSubscriptionWhereInput { export interface PostCreateWithoutVotesInput { isPublished?: Boolean; - slug?: String; title: String; + normalizeTitle: String; text: String; author: UserCreateOneWithoutPostsInput; subCategories?: SubCategoryCreateManyWithoutPostsInput; @@ -517,6 +521,20 @@ export interface CategoryWhereInput { title_not_starts_with?: String; title_ends_with?: String; title_not_ends_with?: String; + normalizeTitle?: String; + normalizeTitle_not?: String; + normalizeTitle_in?: String[] | String; + normalizeTitle_not_in?: String[] | String; + normalizeTitle_lt?: String; + normalizeTitle_lte?: String; + normalizeTitle_gt?: String; + normalizeTitle_gte?: String; + normalizeTitle_contains?: String; + normalizeTitle_not_contains?: String; + normalizeTitle_starts_with?: String; + normalizeTitle_not_starts_with?: String; + normalizeTitle_ends_with?: String; + normalizeTitle_not_ends_with?: String; subCategories_every?: SubCategoryWhereInput; subCategories_some?: SubCategoryWhereInput; subCategories_none?: SubCategoryWhereInput; @@ -660,6 +678,7 @@ export interface UserWhereInput { export interface SubCategoryCreateWithoutPostsInput { title: String; + normalizeTitle: String; categories?: CategoryCreateManyWithoutSubCategoriesInput; } @@ -694,6 +713,7 @@ export interface CategorySubscriptionWhereInput { export interface CategoryCreateWithoutSubCategoriesInput { title: String; + normalizeTitle: String; } export interface VoteUpdateManyMutationInput { @@ -761,6 +781,7 @@ export interface UserCreateWithoutVotesInput { export interface SubCategoryUpdateInput { title?: String; + normalizeTitle?: String; categories?: CategoryUpdateManyWithoutSubCategoriesInput; posts?: PostUpdateManyWithoutSubCategoriesInput; } @@ -772,14 +793,14 @@ export interface PostCreateManyWithoutAuthorInput { export type PostWhereUniqueInput = AtLeastOne<{ id: ID_Input; - slug?: String; title?: String; + normalizeTitle?: String; }>; export interface PostCreateWithoutAuthorInput { isPublished?: Boolean; - slug?: String; title: String; + normalizeTitle: String; text: String; votes?: VoteCreateManyWithoutPostInput; subCategories?: SubCategoryCreateManyWithoutPostsInput; @@ -788,8 +809,8 @@ export interface PostCreateWithoutAuthorInput { export interface PostUpdateInput { isPublished?: Boolean; - slug?: String; title?: String; + normalizeTitle?: String; text?: String; author?: UserUpdateOneRequiredWithoutPostsInput; votes?: VoteUpdateManyWithoutPostInput; @@ -799,12 +820,14 @@ export interface PostUpdateInput { export interface CategoryUpdateInput { title?: String; + normalizeTitle?: String; subCategories?: SubCategoryUpdateManyWithoutCategoriesInput; } export type SubCategoryWhereUniqueInput = AtLeastOne<{ id: ID_Input; title?: String; + normalizeTitle?: String; }>; export interface SubCategoryUpdateManyWithoutCategoriesInput { @@ -854,6 +877,7 @@ export type UserWhereUniqueInput = AtLeastOne<{ export interface SubCategoryUpdateWithoutCategoriesDataInput { title?: String; + normalizeTitle?: String; posts?: PostUpdateManyWithoutSubCategoriesInput; } @@ -925,20 +949,6 @@ export interface PostScalarWhereInput { updatedAt_gte?: DateTimeInput; isPublished?: Boolean; isPublished_not?: Boolean; - slug?: String; - slug_not?: String; - slug_in?: String[] | String; - slug_not_in?: String[] | String; - slug_lt?: String; - slug_lte?: String; - slug_gt?: String; - slug_gte?: String; - slug_contains?: String; - slug_not_contains?: String; - slug_starts_with?: String; - slug_not_starts_with?: String; - slug_ends_with?: String; - slug_not_ends_with?: String; title?: String; title_not?: String; title_in?: String[] | String; @@ -953,6 +963,20 @@ export interface PostScalarWhereInput { title_not_starts_with?: String; title_ends_with?: String; title_not_ends_with?: String; + normalizeTitle?: String; + normalizeTitle_not?: String; + normalizeTitle_in?: String[] | String; + normalizeTitle_not_in?: String[] | String; + normalizeTitle_lt?: String; + normalizeTitle_lte?: String; + normalizeTitle_gt?: String; + normalizeTitle_gte?: String; + normalizeTitle_contains?: String; + normalizeTitle_not_contains?: String; + normalizeTitle_starts_with?: String; + normalizeTitle_not_starts_with?: String; + normalizeTitle_ends_with?: String; + normalizeTitle_not_ends_with?: String; text?: String; text_not?: String; text_in?: String[] | String; @@ -988,8 +1012,8 @@ export interface PostScalarWhereInput { export interface PostUpdateWithoutSubCategoriesDataInput { isPublished?: Boolean; - slug?: String; title?: String; + normalizeTitle?: String; text?: String; author?: UserUpdateOneRequiredWithoutPostsInput; votes?: VoteUpdateManyWithoutPostInput; @@ -998,8 +1022,8 @@ export interface PostUpdateWithoutSubCategoriesDataInput { export interface PostUpdateWithoutAuthorDataInput { isPublished?: Boolean; - slug?: String; title?: String; + normalizeTitle?: String; text?: String; votes?: VoteUpdateManyWithoutPostInput; subCategories?: SubCategoryUpdateManyWithoutPostsInput; @@ -1009,6 +1033,7 @@ export interface PostUpdateWithoutAuthorDataInput { export type CategoryWhereUniqueInput = AtLeastOne<{ id: ID_Input; title?: String; + normalizeTitle?: String; }>; export interface AppStateCreateInput { @@ -1107,8 +1132,8 @@ export interface UserCreateOneWithoutPostsInput { export interface PostUpdateWithoutVotesDataInput { isPublished?: Boolean; - slug?: String; title?: String; + normalizeTitle?: String; text?: String; author?: UserUpdateOneRequiredWithoutPostsInput; subCategories?: SubCategoryUpdateManyWithoutPostsInput; @@ -1179,20 +1204,6 @@ export interface PostWhereInput { updatedAt_gte?: DateTimeInput; isPublished?: Boolean; isPublished_not?: Boolean; - slug?: String; - slug_not?: String; - slug_in?: String[] | String; - slug_not_in?: String[] | String; - slug_lt?: String; - slug_lte?: String; - slug_gt?: String; - slug_gte?: String; - slug_contains?: String; - slug_not_contains?: String; - slug_starts_with?: String; - slug_not_starts_with?: String; - slug_ends_with?: String; - slug_not_ends_with?: String; title?: String; title_not?: String; title_in?: String[] | String; @@ -1207,6 +1218,20 @@ export interface PostWhereInput { title_not_starts_with?: String; title_ends_with?: String; title_not_ends_with?: String; + normalizeTitle?: String; + normalizeTitle_not?: String; + normalizeTitle_in?: String[] | String; + normalizeTitle_not_in?: String[] | String; + normalizeTitle_lt?: String; + normalizeTitle_lte?: String; + normalizeTitle_gt?: String; + normalizeTitle_gte?: String; + normalizeTitle_contains?: String; + normalizeTitle_not_contains?: String; + normalizeTitle_starts_with?: String; + normalizeTitle_not_starts_with?: String; + normalizeTitle_ends_with?: String; + normalizeTitle_not_ends_with?: String; text?: String; text_not?: String; text_in?: String[] | String; @@ -1296,6 +1321,7 @@ export interface VoteWhereInput { export interface SubCategoryUpdateWithoutPostsDataInput { title?: String; + normalizeTitle?: String; categories?: CategoryUpdateManyWithoutSubCategoriesInput; } @@ -1366,18 +1392,20 @@ export interface CategoryUpdateWithWhereUniqueWithoutSubCategoriesInput { export interface SubCategoryCreateInput { title: String; + normalizeTitle: String; categories?: CategoryCreateManyWithoutSubCategoriesInput; posts?: PostCreateManyWithoutSubCategoriesInput; } export interface CategoryUpdateWithoutSubCategoriesDataInput { title?: String; + normalizeTitle?: String; } export interface PostCreateInput { isPublished?: Boolean; - slug?: String; title: String; + normalizeTitle: String; text: String; author: UserCreateOneWithoutPostsInput; votes?: VoteCreateManyWithoutPostInput; @@ -1442,6 +1470,20 @@ export interface CategoryScalarWhereInput { title_not_starts_with?: String; title_ends_with?: String; title_not_ends_with?: String; + normalizeTitle?: String; + normalizeTitle_not?: String; + normalizeTitle_in?: String[] | String; + normalizeTitle_not_in?: String[] | String; + normalizeTitle_lt?: String; + normalizeTitle_lte?: String; + normalizeTitle_gt?: String; + normalizeTitle_gte?: String; + normalizeTitle_contains?: String; + normalizeTitle_not_contains?: String; + normalizeTitle_starts_with?: String; + normalizeTitle_not_starts_with?: String; + normalizeTitle_ends_with?: String; + normalizeTitle_not_ends_with?: String; AND?: CategoryScalarWhereInput[] | CategoryScalarWhereInput; OR?: CategoryScalarWhereInput[] | CategoryScalarWhereInput; NOT?: CategoryScalarWhereInput[] | CategoryScalarWhereInput; @@ -1449,8 +1491,8 @@ export interface CategoryScalarWhereInput { export interface PostUpdateManyDataInput { isPublished?: Boolean; - slug?: String; title?: String; + normalizeTitle?: String; text?: String; thumbnail?: String; } @@ -1468,6 +1510,7 @@ export interface PostUpsertWithWhereUniqueWithoutAuthorInput { export interface CategoryUpdateManyDataInput { title?: String; + normalizeTitle?: String; } export interface AppStateUpdateInput { @@ -1482,6 +1525,7 @@ export interface SubCategoryUpsertWithWhereUniqueWithoutPostsInput { export interface CategoryCreateInput { title: String; + normalizeTitle: String; subCategories?: SubCategoryCreateManyWithoutCategoriesInput; } @@ -1530,6 +1574,20 @@ export interface SubCategoryScalarWhereInput { title_not_starts_with?: String; title_ends_with?: String; title_not_ends_with?: String; + normalizeTitle?: String; + normalizeTitle_not?: String; + normalizeTitle_in?: String[] | String; + normalizeTitle_not_in?: String[] | String; + normalizeTitle_lt?: String; + normalizeTitle_lte?: String; + normalizeTitle_gt?: String; + normalizeTitle_gte?: String; + normalizeTitle_contains?: String; + normalizeTitle_not_contains?: String; + normalizeTitle_starts_with?: String; + normalizeTitle_not_starts_with?: String; + normalizeTitle_ends_with?: String; + normalizeTitle_not_ends_with?: String; AND?: SubCategoryScalarWhereInput[] | SubCategoryScalarWhereInput; OR?: SubCategoryScalarWhereInput[] | SubCategoryScalarWhereInput; NOT?: SubCategoryScalarWhereInput[] | SubCategoryScalarWhereInput; @@ -1537,8 +1595,8 @@ export interface SubCategoryScalarWhereInput { export interface PostCreateWithoutSubCategoriesInput { isPublished?: Boolean; - slug?: String; title: String; + normalizeTitle: String; text: String; author: UserCreateOneWithoutPostsInput; votes?: VoteCreateManyWithoutPostInput; @@ -1595,6 +1653,20 @@ export interface SubCategoryWhereInput { title_not_starts_with?: String; title_ends_with?: String; title_not_ends_with?: String; + normalizeTitle?: String; + normalizeTitle_not?: String; + normalizeTitle_in?: String[] | String; + normalizeTitle_not_in?: String[] | String; + normalizeTitle_lt?: String; + normalizeTitle_lte?: String; + normalizeTitle_gt?: String; + normalizeTitle_gte?: String; + normalizeTitle_contains?: String; + normalizeTitle_not_contains?: String; + normalizeTitle_starts_with?: String; + normalizeTitle_not_starts_with?: String; + normalizeTitle_ends_with?: String; + normalizeTitle_not_ends_with?: String; categories_every?: CategoryWhereInput; categories_some?: CategoryWhereInput; categories_none?: CategoryWhereInput; @@ -1608,6 +1680,7 @@ export interface SubCategoryWhereInput { export interface SubCategoryUpdateManyDataInput { title?: String; + normalizeTitle?: String; } export interface AppStateSubscriptionWhereInput { @@ -1628,6 +1701,7 @@ export interface PostUpsertWithoutVotesInput { export interface SubCategoryUpdateManyMutationInput { title?: String; + normalizeTitle?: String; } export interface VoteUpsertWithWhereUniqueWithoutUserInput { @@ -1638,6 +1712,7 @@ export interface VoteUpsertWithWhereUniqueWithoutUserInput { export interface CategoryUpdateManyMutationInput { title?: String; + normalizeTitle?: String; } export interface VoteScalarWhereInput { @@ -1756,8 +1831,8 @@ export interface UserUpsertWithoutPostsInput { export interface PostUpdateManyMutationInput { isPublished?: Boolean; - slug?: String; title?: String; + normalizeTitle?: String; text?: String; thumbnail?: String; } @@ -1775,6 +1850,7 @@ export interface SubCategorySubscriptionWhereInput { export interface SubCategoryCreateWithoutCategoriesInput { title: String; + normalizeTitle: String; posts?: PostCreateManyWithoutSubCategoriesInput; } @@ -1845,6 +1921,7 @@ export interface SubCategoryPreviousValues { createdAt: DateTimeOutput; updatedAt: DateTimeOutput; title: String; + normalizeTitle: String; } export interface SubCategoryPreviousValuesPromise @@ -1854,6 +1931,7 @@ export interface SubCategoryPreviousValuesPromise createdAt: () => Promise; updatedAt: () => Promise; title: () => Promise; + normalizeTitle: () => Promise; } export interface SubCategoryPreviousValuesSubscription @@ -1863,6 +1941,7 @@ export interface SubCategoryPreviousValuesSubscription createdAt: () => Promise>; updatedAt: () => Promise>; title: () => Promise>; + normalizeTitle: () => Promise>; } export interface User { @@ -1974,8 +2053,8 @@ export interface Post { createdAt: DateTimeOutput; updatedAt: DateTimeOutput; isPublished: Boolean; - slug?: String; title: String; + normalizeTitle: String; text: String; thumbnail?: String; } @@ -1985,8 +2064,8 @@ export interface PostPromise extends Promise, Fragmentable { createdAt: () => Promise; updatedAt: () => Promise; isPublished: () => Promise; - slug: () => Promise; title: () => Promise; + normalizeTitle: () => Promise; text: () => Promise; author: () => T; votes: >( @@ -2021,8 +2100,8 @@ export interface PostSubscription createdAt: () => Promise>; updatedAt: () => Promise>; isPublished: () => Promise>; - slug: () => Promise>; title: () => Promise>; + normalizeTitle: () => Promise>; text: () => Promise>; author: () => T; votes: >>( @@ -2071,6 +2150,7 @@ export interface Category { createdAt: DateTimeOutput; updatedAt: DateTimeOutput; title: String; + normalizeTitle: String; } export interface CategoryPromise extends Promise, Fragmentable { @@ -2078,6 +2158,7 @@ export interface CategoryPromise extends Promise, Fragmentable { createdAt: () => Promise; updatedAt: () => Promise; title: () => Promise; + normalizeTitle: () => Promise; subCategories: >( args?: { where?: SubCategoryWhereInput; @@ -2098,6 +2179,7 @@ export interface CategorySubscription createdAt: () => Promise>; updatedAt: () => Promise>; title: () => Promise>; + normalizeTitle: () => Promise>; subCategories: >>( args?: { where?: SubCategoryWhereInput; @@ -2175,6 +2257,7 @@ export interface SubCategory { createdAt: DateTimeOutput; updatedAt: DateTimeOutput; title: String; + normalizeTitle: String; } export interface SubCategoryPromise extends Promise, Fragmentable { @@ -2182,6 +2265,7 @@ export interface SubCategoryPromise extends Promise, Fragmentable { createdAt: () => Promise; updatedAt: () => Promise; title: () => Promise; + normalizeTitle: () => Promise; categories: >( args?: { where?: CategoryWhereInput; @@ -2213,6 +2297,7 @@ export interface SubCategorySubscription createdAt: () => Promise>; updatedAt: () => Promise>; title: () => Promise>; + normalizeTitle: () => Promise>; categories: >>( args?: { where?: CategoryWhereInput; @@ -2529,6 +2614,7 @@ export interface CategoryPreviousValues { createdAt: DateTimeOutput; updatedAt: DateTimeOutput; title: String; + normalizeTitle: String; } export interface CategoryPreviousValuesPromise @@ -2538,6 +2624,7 @@ export interface CategoryPreviousValuesPromise createdAt: () => Promise; updatedAt: () => Promise; title: () => Promise; + normalizeTitle: () => Promise; } export interface CategoryPreviousValuesSubscription @@ -2547,6 +2634,7 @@ export interface CategoryPreviousValuesSubscription createdAt: () => Promise>; updatedAt: () => Promise>; title: () => Promise>; + normalizeTitle: () => Promise>; } export interface AggregateSubCategory { @@ -2677,8 +2765,8 @@ export interface PostPreviousValues { createdAt: DateTimeOutput; updatedAt: DateTimeOutput; isPublished: Boolean; - slug?: String; title: String; + normalizeTitle: String; text: String; thumbnail?: String; } @@ -2690,8 +2778,8 @@ export interface PostPreviousValuesPromise createdAt: () => Promise; updatedAt: () => Promise; isPublished: () => Promise; - slug: () => Promise; title: () => Promise; + normalizeTitle: () => Promise; text: () => Promise; thumbnail: () => Promise; } @@ -2703,8 +2791,8 @@ export interface PostPreviousValuesSubscription createdAt: () => Promise>; updatedAt: () => Promise>; isPublished: () => Promise>; - slug: () => Promise>; title: () => Promise>; + normalizeTitle: () => Promise>; text: () => Promise>; thumbnail: () => Promise>; } diff --git a/src/generated/prisma-client/prisma-schema.ts b/src/generated/prisma-client/prisma-schema.ts index a979b9b..8c877d1 100644 --- a/src/generated/prisma-client/prisma-schema.ts +++ b/src/generated/prisma-client/prisma-schema.ts @@ -135,6 +135,7 @@ type Category { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! subCategories(where: SubCategoryWhereInput, orderBy: SubCategoryOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [SubCategory!] } @@ -146,6 +147,7 @@ type CategoryConnection { input CategoryCreateInput { title: String! + normalizeTitle: String! subCategories: SubCategoryCreateManyWithoutCategoriesInput } @@ -156,6 +158,7 @@ input CategoryCreateManyWithoutSubCategoriesInput { input CategoryCreateWithoutSubCategoriesInput { title: String! + normalizeTitle: String! } type CategoryEdge { @@ -172,6 +175,8 @@ enum CategoryOrderByInput { updatedAt_DESC title_ASC title_DESC + normalizeTitle_ASC + normalizeTitle_DESC } type CategoryPreviousValues { @@ -179,6 +184,7 @@ type CategoryPreviousValues { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! } input CategoryScalarWhereInput { @@ -226,6 +232,20 @@ input CategoryScalarWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String AND: [CategoryScalarWhereInput!] OR: [CategoryScalarWhereInput!] NOT: [CategoryScalarWhereInput!] @@ -251,15 +271,18 @@ input CategorySubscriptionWhereInput { input CategoryUpdateInput { title: String + normalizeTitle: String subCategories: SubCategoryUpdateManyWithoutCategoriesInput } input CategoryUpdateManyDataInput { title: String + normalizeTitle: String } input CategoryUpdateManyMutationInput { title: String + normalizeTitle: String } input CategoryUpdateManyWithoutSubCategoriesInput { @@ -281,6 +304,7 @@ input CategoryUpdateManyWithWhereNestedInput { input CategoryUpdateWithoutSubCategoriesDataInput { title: String + normalizeTitle: String } input CategoryUpdateWithWhereUniqueWithoutSubCategoriesInput { @@ -339,6 +363,20 @@ input CategoryWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String subCategories_every: SubCategoryWhereInput subCategories_some: SubCategoryWhereInput subCategories_none: SubCategoryWhereInput @@ -350,6 +388,7 @@ input CategoryWhereInput { input CategoryWhereUniqueInput { id: ID title: String + normalizeTitle: String } scalar DateTime @@ -417,8 +456,8 @@ type Post { createdAt: DateTime! updatedAt: DateTime! isPublished: Boolean! - slug: String title: String! + normalizeTitle: String! text: String! author: User! votes(where: VoteWhereInput, orderBy: VoteOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Vote!] @@ -434,8 +473,8 @@ type PostConnection { input PostCreateInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! author: UserCreateOneWithoutPostsInput! votes: VoteCreateManyWithoutPostInput @@ -460,8 +499,8 @@ input PostCreateOneWithoutVotesInput { input PostCreateWithoutAuthorInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! votes: VoteCreateManyWithoutPostInput subCategories: SubCategoryCreateManyWithoutPostsInput @@ -470,8 +509,8 @@ input PostCreateWithoutAuthorInput { input PostCreateWithoutSubCategoriesInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! author: UserCreateOneWithoutPostsInput! votes: VoteCreateManyWithoutPostInput @@ -480,8 +519,8 @@ input PostCreateWithoutSubCategoriesInput { input PostCreateWithoutVotesInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! author: UserCreateOneWithoutPostsInput! subCategories: SubCategoryCreateManyWithoutPostsInput @@ -502,10 +541,10 @@ enum PostOrderByInput { updatedAt_DESC isPublished_ASC isPublished_DESC - slug_ASC - slug_DESC title_ASC title_DESC + normalizeTitle_ASC + normalizeTitle_DESC text_ASC text_DESC thumbnail_ASC @@ -517,8 +556,8 @@ type PostPreviousValues { createdAt: DateTime! updatedAt: DateTime! isPublished: Boolean! - slug: String title: String! + normalizeTitle: String! text: String! thumbnail: String } @@ -556,20 +595,6 @@ input PostScalarWhereInput { updatedAt_gte: DateTime isPublished: Boolean isPublished_not: Boolean - slug: String - slug_not: String - slug_in: [String!] - slug_not_in: [String!] - slug_lt: String - slug_lte: String - slug_gt: String - slug_gte: String - slug_contains: String - slug_not_contains: String - slug_starts_with: String - slug_not_starts_with: String - slug_ends_with: String - slug_not_ends_with: String title: String title_not: String title_in: [String!] @@ -584,6 +609,20 @@ input PostScalarWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String text: String text_not: String text_in: [String!] @@ -637,8 +676,8 @@ input PostSubscriptionWhereInput { input PostUpdateInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String author: UserUpdateOneRequiredWithoutPostsInput votes: VoteUpdateManyWithoutPostInput @@ -648,16 +687,16 @@ input PostUpdateInput { input PostUpdateManyDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String thumbnail: String } input PostUpdateManyMutationInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String thumbnail: String } @@ -702,8 +741,8 @@ input PostUpdateOneWithoutVotesInput { input PostUpdateWithoutAuthorDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String votes: VoteUpdateManyWithoutPostInput subCategories: SubCategoryUpdateManyWithoutPostsInput @@ -712,8 +751,8 @@ input PostUpdateWithoutAuthorDataInput { input PostUpdateWithoutSubCategoriesDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String author: UserUpdateOneRequiredWithoutPostsInput votes: VoteUpdateManyWithoutPostInput @@ -722,8 +761,8 @@ input PostUpdateWithoutSubCategoriesDataInput { input PostUpdateWithoutVotesDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String author: UserUpdateOneRequiredWithoutPostsInput subCategories: SubCategoryUpdateManyWithoutPostsInput @@ -790,20 +829,6 @@ input PostWhereInput { updatedAt_gte: DateTime isPublished: Boolean isPublished_not: Boolean - slug: String - slug_not: String - slug_in: [String!] - slug_not_in: [String!] - slug_lt: String - slug_lte: String - slug_gt: String - slug_gte: String - slug_contains: String - slug_not_contains: String - slug_starts_with: String - slug_not_starts_with: String - slug_ends_with: String - slug_not_ends_with: String title: String title_not: String title_in: [String!] @@ -818,6 +843,20 @@ input PostWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String text: String text_not: String text_in: [String!] @@ -860,8 +899,8 @@ input PostWhereInput { input PostWhereUniqueInput { id: ID - slug: String title: String + normalizeTitle: String } type Query { @@ -891,6 +930,7 @@ type SubCategory { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! categories(where: CategoryWhereInput, orderBy: CategoryOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Category!] posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post!] } @@ -903,6 +943,7 @@ type SubCategoryConnection { input SubCategoryCreateInput { title: String! + normalizeTitle: String! categories: CategoryCreateManyWithoutSubCategoriesInput posts: PostCreateManyWithoutSubCategoriesInput } @@ -919,11 +960,13 @@ input SubCategoryCreateManyWithoutPostsInput { input SubCategoryCreateWithoutCategoriesInput { title: String! + normalizeTitle: String! posts: PostCreateManyWithoutSubCategoriesInput } input SubCategoryCreateWithoutPostsInput { title: String! + normalizeTitle: String! categories: CategoryCreateManyWithoutSubCategoriesInput } @@ -941,6 +984,8 @@ enum SubCategoryOrderByInput { updatedAt_DESC title_ASC title_DESC + normalizeTitle_ASC + normalizeTitle_DESC } type SubCategoryPreviousValues { @@ -948,6 +993,7 @@ type SubCategoryPreviousValues { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! } input SubCategoryScalarWhereInput { @@ -995,6 +1041,20 @@ input SubCategoryScalarWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String AND: [SubCategoryScalarWhereInput!] OR: [SubCategoryScalarWhereInput!] NOT: [SubCategoryScalarWhereInput!] @@ -1020,16 +1080,19 @@ input SubCategorySubscriptionWhereInput { input SubCategoryUpdateInput { title: String + normalizeTitle: String categories: CategoryUpdateManyWithoutSubCategoriesInput posts: PostUpdateManyWithoutSubCategoriesInput } input SubCategoryUpdateManyDataInput { title: String + normalizeTitle: String } input SubCategoryUpdateManyMutationInput { title: String + normalizeTitle: String } input SubCategoryUpdateManyWithoutCategoriesInput { @@ -1063,11 +1126,13 @@ input SubCategoryUpdateManyWithWhereNestedInput { input SubCategoryUpdateWithoutCategoriesDataInput { title: String + normalizeTitle: String posts: PostUpdateManyWithoutSubCategoriesInput } input SubCategoryUpdateWithoutPostsDataInput { title: String + normalizeTitle: String categories: CategoryUpdateManyWithoutSubCategoriesInput } @@ -1138,6 +1203,20 @@ input SubCategoryWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String categories_every: CategoryWhereInput categories_some: CategoryWhereInput categories_none: CategoryWhereInput @@ -1152,6 +1231,7 @@ input SubCategoryWhereInput { input SubCategoryWhereUniqueInput { id: ID title: String + normalizeTitle: String } type Subscription { diff --git a/src/generated/prisma.graphql b/src/generated/prisma.graphql index 49922e5..ce5f08d 100644 --- a/src/generated/prisma.graphql +++ b/src/generated/prisma.graphql @@ -131,6 +131,7 @@ type Category { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! subCategories(where: SubCategoryWhereInput, orderBy: SubCategoryOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [SubCategory!] } @@ -142,6 +143,7 @@ type CategoryConnection { input CategoryCreateInput { title: String! + normalizeTitle: String! subCategories: SubCategoryCreateManyWithoutCategoriesInput } @@ -152,6 +154,7 @@ input CategoryCreateManyWithoutSubCategoriesInput { input CategoryCreateWithoutSubCategoriesInput { title: String! + normalizeTitle: String! } type CategoryEdge { @@ -168,6 +171,8 @@ enum CategoryOrderByInput { updatedAt_DESC title_ASC title_DESC + normalizeTitle_ASC + normalizeTitle_DESC } type CategoryPreviousValues { @@ -175,6 +180,7 @@ type CategoryPreviousValues { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! } input CategoryScalarWhereInput { @@ -222,6 +228,20 @@ input CategoryScalarWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String AND: [CategoryScalarWhereInput!] OR: [CategoryScalarWhereInput!] NOT: [CategoryScalarWhereInput!] @@ -247,15 +267,18 @@ input CategorySubscriptionWhereInput { input CategoryUpdateInput { title: String + normalizeTitle: String subCategories: SubCategoryUpdateManyWithoutCategoriesInput } input CategoryUpdateManyDataInput { title: String + normalizeTitle: String } input CategoryUpdateManyMutationInput { title: String + normalizeTitle: String } input CategoryUpdateManyWithoutSubCategoriesInput { @@ -277,6 +300,7 @@ input CategoryUpdateManyWithWhereNestedInput { input CategoryUpdateWithoutSubCategoriesDataInput { title: String + normalizeTitle: String } input CategoryUpdateWithWhereUniqueWithoutSubCategoriesInput { @@ -335,6 +359,20 @@ input CategoryWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String subCategories_every: SubCategoryWhereInput subCategories_some: SubCategoryWhereInput subCategories_none: SubCategoryWhereInput @@ -346,6 +384,7 @@ input CategoryWhereInput { input CategoryWhereUniqueInput { id: ID title: String + normalizeTitle: String } scalar DateTime @@ -413,8 +452,8 @@ type Post { createdAt: DateTime! updatedAt: DateTime! isPublished: Boolean! - slug: String title: String! + normalizeTitle: String! text: String! author: User! votes(where: VoteWhereInput, orderBy: VoteOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Vote!] @@ -430,8 +469,8 @@ type PostConnection { input PostCreateInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! author: UserCreateOneWithoutPostsInput! votes: VoteCreateManyWithoutPostInput @@ -456,8 +495,8 @@ input PostCreateOneWithoutVotesInput { input PostCreateWithoutAuthorInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! votes: VoteCreateManyWithoutPostInput subCategories: SubCategoryCreateManyWithoutPostsInput @@ -466,8 +505,8 @@ input PostCreateWithoutAuthorInput { input PostCreateWithoutSubCategoriesInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! author: UserCreateOneWithoutPostsInput! votes: VoteCreateManyWithoutPostInput @@ -476,8 +515,8 @@ input PostCreateWithoutSubCategoriesInput { input PostCreateWithoutVotesInput { isPublished: Boolean - slug: String title: String! + normalizeTitle: String! text: String! author: UserCreateOneWithoutPostsInput! subCategories: SubCategoryCreateManyWithoutPostsInput @@ -498,10 +537,10 @@ enum PostOrderByInput { updatedAt_DESC isPublished_ASC isPublished_DESC - slug_ASC - slug_DESC title_ASC title_DESC + normalizeTitle_ASC + normalizeTitle_DESC text_ASC text_DESC thumbnail_ASC @@ -513,8 +552,8 @@ type PostPreviousValues { createdAt: DateTime! updatedAt: DateTime! isPublished: Boolean! - slug: String title: String! + normalizeTitle: String! text: String! thumbnail: String } @@ -552,20 +591,6 @@ input PostScalarWhereInput { updatedAt_gte: DateTime isPublished: Boolean isPublished_not: Boolean - slug: String - slug_not: String - slug_in: [String!] - slug_not_in: [String!] - slug_lt: String - slug_lte: String - slug_gt: String - slug_gte: String - slug_contains: String - slug_not_contains: String - slug_starts_with: String - slug_not_starts_with: String - slug_ends_with: String - slug_not_ends_with: String title: String title_not: String title_in: [String!] @@ -580,6 +605,20 @@ input PostScalarWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String text: String text_not: String text_in: [String!] @@ -633,8 +672,8 @@ input PostSubscriptionWhereInput { input PostUpdateInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String author: UserUpdateOneRequiredWithoutPostsInput votes: VoteUpdateManyWithoutPostInput @@ -644,16 +683,16 @@ input PostUpdateInput { input PostUpdateManyDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String thumbnail: String } input PostUpdateManyMutationInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String thumbnail: String } @@ -698,8 +737,8 @@ input PostUpdateOneWithoutVotesInput { input PostUpdateWithoutAuthorDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String votes: VoteUpdateManyWithoutPostInput subCategories: SubCategoryUpdateManyWithoutPostsInput @@ -708,8 +747,8 @@ input PostUpdateWithoutAuthorDataInput { input PostUpdateWithoutSubCategoriesDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String author: UserUpdateOneRequiredWithoutPostsInput votes: VoteUpdateManyWithoutPostInput @@ -718,8 +757,8 @@ input PostUpdateWithoutSubCategoriesDataInput { input PostUpdateWithoutVotesDataInput { isPublished: Boolean - slug: String title: String + normalizeTitle: String text: String author: UserUpdateOneRequiredWithoutPostsInput subCategories: SubCategoryUpdateManyWithoutPostsInput @@ -786,20 +825,6 @@ input PostWhereInput { updatedAt_gte: DateTime isPublished: Boolean isPublished_not: Boolean - slug: String - slug_not: String - slug_in: [String!] - slug_not_in: [String!] - slug_lt: String - slug_lte: String - slug_gt: String - slug_gte: String - slug_contains: String - slug_not_contains: String - slug_starts_with: String - slug_not_starts_with: String - slug_ends_with: String - slug_not_ends_with: String title: String title_not: String title_in: [String!] @@ -814,6 +839,20 @@ input PostWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String text: String text_not: String text_in: [String!] @@ -856,8 +895,8 @@ input PostWhereInput { input PostWhereUniqueInput { id: ID - slug: String title: String + normalizeTitle: String } type Query { @@ -887,6 +926,7 @@ type SubCategory { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! categories(where: CategoryWhereInput, orderBy: CategoryOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Category!] posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post!] } @@ -899,6 +939,7 @@ type SubCategoryConnection { input SubCategoryCreateInput { title: String! + normalizeTitle: String! categories: CategoryCreateManyWithoutSubCategoriesInput posts: PostCreateManyWithoutSubCategoriesInput } @@ -915,11 +956,13 @@ input SubCategoryCreateManyWithoutPostsInput { input SubCategoryCreateWithoutCategoriesInput { title: String! + normalizeTitle: String! posts: PostCreateManyWithoutSubCategoriesInput } input SubCategoryCreateWithoutPostsInput { title: String! + normalizeTitle: String! categories: CategoryCreateManyWithoutSubCategoriesInput } @@ -937,6 +980,8 @@ enum SubCategoryOrderByInput { updatedAt_DESC title_ASC title_DESC + normalizeTitle_ASC + normalizeTitle_DESC } type SubCategoryPreviousValues { @@ -944,6 +989,7 @@ type SubCategoryPreviousValues { createdAt: DateTime! updatedAt: DateTime! title: String! + normalizeTitle: String! } input SubCategoryScalarWhereInput { @@ -991,6 +1037,20 @@ input SubCategoryScalarWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String AND: [SubCategoryScalarWhereInput!] OR: [SubCategoryScalarWhereInput!] NOT: [SubCategoryScalarWhereInput!] @@ -1016,16 +1076,19 @@ input SubCategorySubscriptionWhereInput { input SubCategoryUpdateInput { title: String + normalizeTitle: String categories: CategoryUpdateManyWithoutSubCategoriesInput posts: PostUpdateManyWithoutSubCategoriesInput } input SubCategoryUpdateManyDataInput { title: String + normalizeTitle: String } input SubCategoryUpdateManyMutationInput { title: String + normalizeTitle: String } input SubCategoryUpdateManyWithoutCategoriesInput { @@ -1059,11 +1122,13 @@ input SubCategoryUpdateManyWithWhereNestedInput { input SubCategoryUpdateWithoutCategoriesDataInput { title: String + normalizeTitle: String posts: PostUpdateManyWithoutSubCategoriesInput } input SubCategoryUpdateWithoutPostsDataInput { title: String + normalizeTitle: String categories: CategoryUpdateManyWithoutSubCategoriesInput } @@ -1134,6 +1199,20 @@ input SubCategoryWhereInput { title_not_starts_with: String title_ends_with: String title_not_ends_with: String + normalizeTitle: String + normalizeTitle_not: String + normalizeTitle_in: [String!] + normalizeTitle_not_in: [String!] + normalizeTitle_lt: String + normalizeTitle_lte: String + normalizeTitle_gt: String + normalizeTitle_gte: String + normalizeTitle_contains: String + normalizeTitle_not_contains: String + normalizeTitle_starts_with: String + normalizeTitle_not_starts_with: String + normalizeTitle_ends_with: String + normalizeTitle_not_ends_with: String categories_every: CategoryWhereInput categories_some: CategoryWhereInput categories_none: CategoryWhereInput @@ -1148,6 +1227,7 @@ input SubCategoryWhereInput { input SubCategoryWhereUniqueInput { id: ID title: String + normalizeTitle: String } type Subscription { diff --git a/src/generated/resolvers/Query.ts b/src/generated/resolvers/Query.ts index 862823d..2c71f0d 100644 --- a/src/generated/resolvers/Query.ts +++ b/src/generated/resolvers/Query.ts @@ -20,7 +20,10 @@ export const Query: QueryResolvers.Type = { welcomePost: (parent, args, ctx) => { throw new Error('Resolver not implemented') }, - searchCategories: (parent, args, ctx) => { + subCategories: (parent, args, ctx) => { + throw new Error('Resolver not implemented') + }, + search: (parent, args, ctx) => { throw new Error('Resolver not implemented') }, appState: (parent, args, ctx) => { diff --git a/src/generated/resolvers/SearchResults.ts b/src/generated/resolvers/SearchResults.ts new file mode 100644 index 0000000..a1ae58d --- /dev/null +++ b/src/generated/resolvers/SearchResults.ts @@ -0,0 +1,18 @@ +// This resolver file was scaffolded by github.com/prisma/graphqlgen, DO NOT EDIT. +// Please do not import this file directly but copy & paste to your application code. + +import { SearchResultsResolvers } from '../graphqlgen' + +export const SearchResults: SearchResultsResolvers.Type = { + ...SearchResultsResolvers.defaultResolvers, + + posts: (parent, args, ctx) => { + throw new Error('Resolver not implemented') + }, + subCategories: (parent, args, ctx) => { + throw new Error('Resolver not implemented') + }, + categories: (parent, args, ctx) => { + throw new Error('Resolver not implemented') + }, +} diff --git a/src/generated/resolvers/index.ts b/src/generated/resolvers/index.ts index 7e38093..ca6d6a6 100644 --- a/src/generated/resolvers/index.ts +++ b/src/generated/resolvers/index.ts @@ -10,6 +10,7 @@ import { Vote } from './Vote' import { SubCategory } from './SubCategory' import { Category } from './Category' import { VoteSummary } from './VoteSummary' +import { SearchResults } from './SearchResults' import { AppState } from './AppState' import { Mutation } from './Mutation' import { AuthPayload } from './AuthPayload' @@ -23,6 +24,7 @@ export const resolvers: Resolvers = { SubCategory, Category, VoteSummary, + SearchResults, AppState, Mutation, AuthPayload, diff --git a/src/resolvers/Mutation/post.ts b/src/resolvers/Mutation/post.ts index 268e3b7..0b0fb87 100644 --- a/src/resolvers/Mutation/post.ts +++ b/src/resolvers/Mutation/post.ts @@ -15,6 +15,7 @@ export const post: PostMutationResolvers = { const userId = getUserIdOrThrowError(ctx) return ctx.prisma.createPost({ title, + normalizeTitle: title.toLocaleLowerCase(), text, isPublished: false, author: { diff --git a/src/resolvers/Query.ts b/src/resolvers/Query.ts index 2f7bbaf..74e89e7 100644 --- a/src/resolvers/Query.ts +++ b/src/resolvers/Query.ts @@ -32,14 +32,28 @@ export const Query: QueryResolvers.Type = { }, welcomePost(_parent, _args, ctx) { - return ctx.prisma.post({ slug: 'welcome-post' }) + return ctx.prisma.post({ normalizeTitle: 'welcome post' }) }, - searchCategories(_parent, { value }, ctx) { + subCategories(_parent, _args, ctx) { + return ctx.prisma.subCategories() + }, + + async search(_parent, { value }, ctx) { const where = { - title_contains: value, + normalizeTitle_contains: value, + } + const [posts, subCategories, categories] = await Promise.all([ + ctx.prisma.posts({ where }), + ctx.prisma.subCategories({ where }), + ctx.prisma.categories({ where }), + ]) + + return { + posts, + subCategories, + categories, } - return ctx.prisma.categories({ where }) }, me(_parent, _args, ctx) { diff --git a/src/schema.graphql b/src/schema.graphql index 98473fe..6a8e998 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -1,4 +1,4 @@ -# import Post, Vote, VoteType, UserRole, Category, AppState, PostWhereInput, PostOrderByInput, VoteWhereInput, VoteOrderByInput, SubCategoryWhereInput, SubCategoryOrderByInput from "./generated/prisma.graphql" +# import Post, Vote, VoteType, UserRole, Category, SubCategory, AppState, PostWhereInput, PostOrderByInput, VoteWhereInput, VoteOrderByInput, SubCategoryWhereInput, SubCategoryOrderByInput from "./generated/prisma.graphql" type Query { feed: [Post!]! @@ -12,9 +12,10 @@ type Query { before: String first: Int last: Int - ): [Post]! + ): [Post!]! welcomePost: Post - searchCategories(value: String!): [Category!]! + subCategories: [SubCategory!]! + search(value: String!): SearchResults appState: AppState! me: User } @@ -59,7 +60,6 @@ type Post { createdAt: DateTime! updatedAt: DateTime! isPublished: Boolean! - slug: String title: String! text: String! author: User! @@ -89,3 +89,9 @@ type VoteSummary { likes: Int dislikes: Int } + +type SearchResults { + posts: [Post]! + subCategories: [SubCategory]! + categories: [Category]! +} diff --git a/src/seed-generator.ts b/src/seed-generator.ts index 0ca9a96..2a21abf 100644 --- a/src/seed-generator.ts +++ b/src/seed-generator.ts @@ -17,7 +17,10 @@ const generateUser = async (user: { email: string; name: string }) => { } const generateCategories = async ({ title }: { title: string }) => { - return await db.createCategory({ title }) + return await db.createCategory({ + title, + normalizeTitle: title.toLocaleLowerCase(), + }) } const generateSubCategories = async ({ @@ -34,6 +37,7 @@ const generateSubCategories = async ({ }, }, title, + normalizeTitle: title.toLocaleLowerCase(), }) } @@ -53,6 +57,7 @@ const generatePosts = async ({ }, }, title, + normalizeTitle: title.toLocaleLowerCase(), text: faker.lorem.sentence(), subCategories: { connect: { diff --git a/src/utils.ts b/src/utils.ts index 78c1ad0..3fea102 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -15,6 +15,8 @@ export interface VoteSummary { dislikes: number | null } +export interface SearchResults {} + export function getUserIdOrThrowError(ctx: Context) { const Authorization = ctx.request.get('Authorization') if (Authorization) {