From 76fbbd049d31d389c1da942b60d5b0d4ab640939 Mon Sep 17 00:00:00 2001 From: Barry Low Date: Sun, 17 Mar 2019 21:49:21 +0100 Subject: [PATCH] Fix fbByFBSlug query --- api/src/graphql/resolvers/Query/FinancialBeing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/graphql/resolvers/Query/FinancialBeing.js b/api/src/graphql/resolvers/Query/FinancialBeing.js index d89f0c7ec..7a9e66bb8 100644 --- a/api/src/graphql/resolvers/Query/FinancialBeing.js +++ b/api/src/graphql/resolvers/Query/FinancialBeing.js @@ -11,7 +11,7 @@ export const fbByFbId = async (parent, { fbId }, ctx, info) => { export const fbByFbSlug = async (parent, { fbSlug }, ctx, info) => { logger.info(`fbByFbSlug: ${fbSlug}`) - let FB = await ctx.db.query.financialBeingses({where: {slug: fbSlug}}, FB_FRAGMENT) + let FB = await ctx.db.query.financialBeingses({where: {slug: fbSlug}, first:1}, FB_FRAGMENT) logger.info(`fbByFbSlug response: ${JSON.stringify(await FB)}`) - return FB + return FB[0] }