From 15551ef5b091ae467d66002b0ac1f30f4bf33e4a Mon Sep 17 00:00:00 2001 From: Corey Kovalik Date: Wed, 21 Jul 2021 12:38:25 -0700 Subject: [PATCH] fix: remove conditional requiring 'items' for path arg to get count --- packages/graphback-core/src/runtime/CRUDService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphback-core/src/runtime/CRUDService.ts b/packages/graphback-core/src/runtime/CRUDService.ts index bf35de8c9d..d55fe2bdc0 100644 --- a/packages/graphback-core/src/runtime/CRUDService.ts +++ b/packages/graphback-core/src/runtime/CRUDService.ts @@ -121,7 +121,7 @@ export class CRUDService implements GraphbackCRUDService { let requestedCount: boolean = false; if (info) { selectedFields = getSelectedFieldsFromResolverInfo(info, this.model, path); - requestedCount = path === 'items' && getResolverInfoFieldsList(info).some((field: string) => field === "count"); + requestedCount = getResolverInfoFieldsList(info).some((field: string) => field === "count"); } const items: Type[] = await this.db.findBy(args, selectedFields);