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