remove one dummy query

This commit is contained in:
einhorn_b 2023-09-19 11:20:48 +02:00
parent f2ce9e2aa2
commit 410854054b
2 changed files with 0 additions and 24 deletions

View File

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

View File

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