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.
This commit is contained in:
Robert Schäfer 2019-02-22 15:21:23 +01:00
parent a1e5e866d1
commit 889818cd2d

View File

@ -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