diff --git a/backend/src/graphql/resolvers/TransactionResolver.ts b/backend/src/graphql/resolvers/TransactionResolver.ts index d18c7c300..52af4bd53 100644 --- a/backend/src/graphql/resolvers/TransactionResolver.ts +++ b/backend/src/graphql/resolvers/TransactionResolver.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Resolver, Query, Args, Authorized, Ctx } from 'type-graphql' +import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql' import CONFIG from '../../config' import { TransactionList } from '../models/Transaction' import { TransactionListInput, TransactionSendArgs } from '../inputs/TransactionInput' @@ -23,7 +23,7 @@ export class TransactionResolver { } @Authorized() - @Query(() => String) + @Mutation(() => String) async sendCoins( @Args() { email, amount, memo }: TransactionSendArgs, @Ctx() context: any, diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 7e618cf42..06b10daec 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Resolver, Query, Args, Arg, Authorized, Ctx, UseMiddleware } from 'type-graphql' +import { Resolver, Query, Args, Arg, Authorized, Ctx, UseMiddleware, Mutation } from 'type-graphql' import CONFIG from '../../config' import { CheckUsernameResponse } from '../models/CheckUsernameResponse' import { LoginViaVerificationCode } from '../models/LoginViaVerificationCode' @@ -66,8 +66,8 @@ export class UserResolver { return 'success' } - @Query(() => String) - async create( + @Mutation(() => String) + async createUser( @Args() { email, firstName, lastName, password, language }: CreateUserArgs, ): Promise { const payload = { @@ -104,7 +104,7 @@ export class UserResolver { return new SendPasswordResetEmailResponse(response.data) } - @Query(() => String) + @Mutation(() => String) async resetPassword( @Args() { sessionId, email, password }: ChangePasswordArgs, @@ -122,7 +122,7 @@ export class UserResolver { } @Authorized() - @Query(() => UpdateUserInfosResponse) + @Mutation(() => UpdateUserInfosResponse) async updateUserInfos( @Args() { diff --git a/frontend/src/components/LanguageSwitch.spec.js b/frontend/src/components/LanguageSwitch.spec.js index afe98b357..dc76d854b 100644 --- a/frontend/src/components/LanguageSwitch.spec.js +++ b/frontend/src/components/LanguageSwitch.spec.js @@ -3,7 +3,7 @@ import LanguageSwitch from './LanguageSwitch' const localVue = global.localVue -const updateUserInfosQueryMock = jest.fn().mockResolvedValue({ +const updateUserInfosMutationMock = jest.fn().mockResolvedValue({ data: { updateUserInfos: { validValues: 1, @@ -28,7 +28,7 @@ describe('LanguageSwitch', () => { locale: 'en', }, $apollo: { - query: updateUserInfosQueryMock, + mutate: updateUserInfosMutationMock, }, } @@ -119,7 +119,7 @@ describe('LanguageSwitch', () => { describe('calls the API', () => { it("with locale 'en'", () => { wrapper.findAll('li').at(0).find('a').trigger('click') - expect(updateUserInfosQueryMock).toBeCalledWith( + expect(updateUserInfosMutationMock).toBeCalledWith( expect.objectContaining({ variables: { email: 'he@ho.he', @@ -131,7 +131,7 @@ describe('LanguageSwitch', () => { it("with locale 'de'", () => { wrapper.findAll('li').at(1).find('a').trigger('click') - expect(updateUserInfosQueryMock).toBeCalledWith( + expect(updateUserInfosMutationMock).toBeCalledWith( expect.objectContaining({ variables: { email: 'he@ho.he', diff --git a/frontend/src/components/LanguageSwitch.vue b/frontend/src/components/LanguageSwitch.vue index f0528a935..14894e46e 100644 --- a/frontend/src/components/LanguageSwitch.vue +++ b/frontend/src/components/LanguageSwitch.vue @@ -14,7 +14,7 @@