From 889818cd2de5ae5bca1bced8dcf4335045af4cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Fri, 22 Feb 2019 15:21:23 +0100 Subject: [PATCH] Expose bug in Query { isLoggedin } The idMiddleware was adding selection fields to the resolveInfo even if the selection fields were empty. This caused a bug for each resolve function including ``` { isLoggedin } ``` which does not have any additional curly braces after the query. --- src/graphql-schema.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/graphql-schema.spec.js b/src/graphql-schema.spec.js index 463d91af2..2211a514a 100644 --- a/src/graphql-schema.spec.js +++ b/src/graphql-schema.spec.js @@ -16,6 +16,15 @@ afterEach(async () => { await factory.cleanDatabase() }) +describe('isLoggedIn', () => { + describe('unauthenticated', () => { + it('returns false', async () => { + const query = '{ isLoggedIn }' + await expect(request(host, query)).resolves.toEqual({ isLoggedIn: false }) + }) + }) +}) + describe('login', () => { const mutation = (params) => { const { email, password } = params