-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more user centric mutations to gql (#4258)
- Loading branch information
Showing
8 changed files
with
181 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
backend/native/backpack-api/src/routes/graphql/resolvers/mutation/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from "./authentication"; | ||
export * from "./friendship"; | ||
export * from "./notifications"; | ||
export * from "./user"; | ||
export * from "./wallets"; |
26 changes: 26 additions & 0 deletions
26
backend/native/backpack-api/src/routes/graphql/resolvers/mutation/user.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { GraphQLResolveInfo } from "graphql"; | ||
|
||
import type { ApiContext } from "../../context"; | ||
import type { MutationResolvers, MutationSetAvatarArgs } from "../../types"; | ||
|
||
/** | ||
* Handler for the mutation to import a new public key to a user account. | ||
* @param {{}} _parent | ||
* @param {MutationSetAvatarArgs} args | ||
* @param {ApiContext} ctx | ||
* @param {GraphQLResolveInfo} _info | ||
* @returns {Promise<boolean>} | ||
*/ | ||
export const setAvatarMutationResolver: MutationResolvers["setAvatar"] = async ( | ||
_parent: {}, | ||
args: MutationSetAvatarArgs, | ||
ctx: ApiContext, | ||
_info: GraphQLResolveInfo | ||
): Promise<boolean> => { | ||
const affectedRows = await ctx.dataSources.hasura.updateUserAvatar( | ||
ctx.authorization.userId!, | ||
args.providerId, | ||
args.nft | ||
); | ||
return affectedRows > 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5de03ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
backpack – ./
backpack.app
backpack-git-master-200ms.vercel.app
devnet.backpack.app
www.backpack.app
backpack-200ms.vercel.app