aboutsummaryrefslogtreecommitdiff
path: root/src/graphql
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-06 05:59:29 -0700
committerFuwn <[email protected]>2024-10-06 05:59:59 -0700
commit5dc4e7b5ce84f804601053cf5c0d7c1494fbd0f2 (patch)
tree521fd2de86baabf2c4e22dcd4d220d78c197d95d /src/graphql
parentfeat(user): live update for mutations (diff)
downloaddue.moe-5dc4e7b5ce84f804601053cf5c0d7c1494fbd0f2.tar.xz
due.moe-5dc4e7b5ce84f804601053cf5c0d7c1494fbd0f2.zip
feat(badges): return user for badge mutations
Diffstat (limited to 'src/graphql')
-rw-r--r--src/graphql/user/resolvers.ts6
-rw-r--r--src/graphql/user/schema.graphql12
2 files changed, 11 insertions, 7 deletions
diff --git a/src/graphql/user/resolvers.ts b/src/graphql/user/resolvers.ts
index 3521f1a2..422d9170 100644
--- a/src/graphql/user/resolvers.ts
+++ b/src/graphql/user/resolvers.ts
@@ -43,7 +43,11 @@ const authenticatedBadgesOperation = async (
operation(identity, authorised);
- return await getUserBadges(identity.id);
+ return {
+ id: identity.id,
+ badges: await getUserBadges(identity.id),
+ preferences: {}
+ }
};
const authenticatedPreferencesOperation = async (
diff --git a/src/graphql/user/schema.graphql b/src/graphql/user/schema.graphql
index b615a995..66d14ce0 100644
--- a/src/graphql/user/schema.graphql
+++ b/src/graphql/user/schema.graphql
@@ -3,9 +3,9 @@ type Query {
}
type Mutation {
- shadowHideBadges(userId: Int!): [Badge]!
- shadowHideBadge(id: Int!, state: Boolean): [Badge]!
- hideBadge(category: String): [Badge]!
+ shadowHideBadges(userId: Int!): User!
+ shadowHideBadge(id: Int!, state: Boolean): User!
+ hideBadge(category: String): User!
updateBadge(
id: Int
post: String
@@ -16,9 +16,9 @@ type Mutation {
hidden: Boolean
source: String
designer: String
- ): [Badge]!
- deleteBadge(id: Int!): [Badge]!
- pruneUserBadges: [Badge]!
+ ): User!
+ deleteBadge(id: Int!): User!
+ pruneUserBadges: User!
toggleHideMissingBadges: User!
toggleHideAWCBadges: User!
setBadgeWallCSS(css: String!): User!