fix: handle graphQL: false on globals when building policy type (#3729)
This commit is contained in:
@@ -80,6 +80,12 @@ export default buildConfigWithDefaults({
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
slug: 'without-graphql',
|
||||
access,
|
||||
graphQL: false,
|
||||
fields: [],
|
||||
},
|
||||
],
|
||||
onInit: async (payload) => {
|
||||
await payload.create({
|
||||
|
||||
@@ -224,5 +224,13 @@ describe('globals', () => {
|
||||
|
||||
expect(doc).toMatchObject(data)
|
||||
})
|
||||
|
||||
it('should not show globals with disabled graphql', async () => {
|
||||
const query = `query {
|
||||
WithoutGraphql { __typename }
|
||||
}`
|
||||
|
||||
await expect(client.request(query)).rejects.toHaveProperty('message')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user