diff --git a/functions/graphql/nexus-typegen.ts b/functions/graphql/nexus-typegen.ts index 4b48c73..f02f63a 100644 --- a/functions/graphql/nexus-typegen.ts +++ b/functions/graphql/nexus-typegen.ts @@ -35,8 +35,8 @@ export interface NexusGenObjects { url: string; // String! } Category: { // root type - cover_image: string; // String! - icon: string; // String! + cover_image?: string | null; // String + icon?: string | null; // String id: number; // Int! title: string; // String! } @@ -93,8 +93,8 @@ export interface NexusGenFieldTypes { } Category: { // field return type apps_count: number; // Int! - cover_image: string; // String! - icon: string; // String! + cover_image: string | null; // String + icon: string | null; // String id: number; // Int! project: NexusGenRootTypes['Project'][]; // [Project!]! title: string; // String! diff --git a/functions/graphql/schema.graphql b/functions/graphql/schema.graphql index 73ce2ce..2b39787 100644 --- a/functions/graphql/schema.graphql +++ b/functions/graphql/schema.graphql @@ -12,8 +12,8 @@ type Award { type Category { apps_count: Int! - cover_image: String! - icon: String! + cover_image: String + icon: String id: Int! project: [Project!]! title: String! diff --git a/functions/graphql/types/category.js b/functions/graphql/types/category.js index ae2edd4..f750708 100644 --- a/functions/graphql/types/category.js +++ b/functions/graphql/types/category.js @@ -55,6 +55,7 @@ const allCategoriesQuery = extendType({ } } }) + console.log(categories); categories.sort((c1, c2) => c2._count.project - c1._count.project) return categories; } diff --git a/serverless.yml b/serverless.yml index ff58a50..46be257 100644 --- a/serverless.yml +++ b/serverless.yml @@ -8,7 +8,7 @@ service: serverless-graphql provider: name: aws runtime: nodejs12.x - region: ap-southeast-2 + functions: graphql: handler: functions/graphql/index.handler