From efa1457b7f6067753e9535f6d0215cf61dbbf771 Mon Sep 17 00:00:00 2001 From: niamu01 Date: Mon, 18 Dec 2023 19:13:00 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20mutation=EC=9D=B4=20=EC=95=84?= =?UTF-8?q?=EB=8B=8C=20=EC=BF=BC=EB=A6=AC=EC=97=90=20=EB=8C=80=ED=95=B4?= =?UTF-8?q?=EC=84=9C=20mutation=20->=20query=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - #405 --- app/src/follow/follow.resolve.ts | 6 +++--- app/src/schema.gql | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/follow/follow.resolve.ts b/app/src/follow/follow.resolve.ts index 76cb673a..58ec0035 100644 --- a/app/src/follow/follow.resolve.ts +++ b/app/src/follow/follow.resolve.ts @@ -1,5 +1,5 @@ import { UseFilters, UseGuards } from '@nestjs/common'; -import { Args, Mutation, Resolver, Subscription } from '@nestjs/graphql'; +import { Args, Mutation, Query, Resolver, Subscription } from '@nestjs/graphql'; import { PubSub } from 'graphql-subscriptions'; import { MyUserId } from 'src/auth/myContext'; import { StatAuthGuard } from 'src/auth/statAuthGuard'; @@ -66,7 +66,7 @@ export class FollowResolver { } @UseGuards(StatAuthGuard) - @Mutation((_returns) => FollowListWithCount) + @Query((_returns) => FollowListWithCount) async getFollowerList( @MyUserId() userId: number, @Args('target') target: string, @@ -84,7 +84,7 @@ export class FollowResolver { } @UseGuards(StatAuthGuard) - @Mutation((_returns) => FollowListWithCount) + @Query((_returns) => FollowListWithCount) async getFollowingList( @MyUserId() userId: number, @Args('target') target: string, diff --git a/app/src/schema.gql b/app/src/schema.gql index 3d80b19c..90d12d67 100644 --- a/app/src/schema.gql +++ b/app/src/schema.gql @@ -631,6 +631,8 @@ type Query { getEvalLogs(after: String, first: Int! = 20, corrector: String, corrected: String, projectName: String, outstandingOnly: Boolean! = false, imperfectOnly: Boolean! = false, sortOrder: EvalLogSortOrder! = BEGIN_AT_DESC): EvalLogsPaginated! getSetting: Setting! getExpTable: [ExpTable!]! + getFollowerList(target: String!): FollowListWithCount! + getFollowingList(target: String!): FollowListWithCount! } enum EvalLogSortOrder { @@ -651,8 +653,6 @@ type Mutation { MakeFollow(to: String!, from: String!, type: String!): FollowResult! followUser(target: String!): FollowResult! unfollowUser(target: String!): FollowResult! - getFollowerList(target: String!): FollowListWithCount! - getFollowingList(target: String!): FollowListWithCount! } union LoginResult = LoginSuccess | LoginNotLinked