mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
remove one dummy query
This commit is contained in:
parent
f2ce9e2aa2
commit
410854054b
@ -16,19 +16,6 @@ describe('graphql/resolver/CommunityResolver', () => {
|
||||
apolloTestServer = await createApolloTestServer()
|
||||
})
|
||||
|
||||
it('test version query', async () => {
|
||||
const response = await apolloTestServer.executeOperation({
|
||||
query: '{ version }',
|
||||
})
|
||||
// Note the use of Node's assert rather than Jest's expect; if using
|
||||
// TypeScript, `assert`` will appropriately narrow the type of `body`
|
||||
// and `expect` will not.
|
||||
// Source: https://www.apollographql.com/docs/apollo-server/testing/testing
|
||||
assert(response.body.kind === 'single')
|
||||
expect(response.body.singleResult.errors).toBeUndefined()
|
||||
expect(response.body.singleResult.data?.version).toBe('0.1')
|
||||
})
|
||||
|
||||
describe('tests with db', () => {
|
||||
beforeAll(async () => {
|
||||
await TestDB.instance.setupTestDB()
|
||||
|
||||
@ -16,17 +16,6 @@ import { logger } from '@/server/logger'
|
||||
|
||||
@Resolver()
|
||||
export class CommunityResolver {
|
||||
// Why a dummy function?
|
||||
// to prevent this error by start:
|
||||
// GeneratingSchemaError: Some errors occurred while generating GraphQL schema:
|
||||
// Type Query must define one or more fields.
|
||||
// it seems that at least one query must be defined
|
||||
// https://github.com/ardatan/graphql-tools/issues/764
|
||||
@Query(() => String)
|
||||
version(): string {
|
||||
return '0.1'
|
||||
}
|
||||
|
||||
@Mutation(() => TransactionResult)
|
||||
async addCommunity(
|
||||
@Arg('data')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user