From 65be95024de4c54770967d35381af6465f024544 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Tue, 15 Apr 2025 21:41:17 +0200 Subject: [PATCH 1/2] Remove unused wallet resolvers --- api/resolvers/wallet.js | 31 ------------------------------- api/typeDefs/wallet.js | 2 -- fragments/wallet.js | 19 ------------------- 3 files changed, 52 deletions(-) diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index c14939d9a..1417f8906 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -154,37 +154,6 @@ export function verifyHmac (hash, hmac) { const resolvers = { Query: { invoice: getInvoice, - wallet: async (parent, { id }, { me, models }) => { - if (!me) { - throw new GqlAuthenticationError() - } - - return await models.wallet.findUnique({ - where: { - userId: me.id, - id: Number(id) - }, - include: { - vaultEntries: true - } - }) - }, - walletByType: async (parent, { type }, { me, models }) => { - if (!me) { - throw new GqlAuthenticationError() - } - - const wallet = await models.wallet.findFirst({ - where: { - userId: me.id, - type - }, - include: { - vaultEntries: true - } - }) - return wallet - }, wallets: async (parent, args, { me, models }) => { if (!me) { throw new GqlAuthenticationError() diff --git a/api/typeDefs/wallet.js b/api/typeDefs/wallet.js index 446462cb7..fbbc9dc30 100644 --- a/api/typeDefs/wallet.js +++ b/api/typeDefs/wallet.js @@ -69,8 +69,6 @@ const typeDefs = ` connectAddress: String! walletHistory(cursor: String, inc: String): History wallets(includeReceivers: Boolean, includeSenders: Boolean, onlyEnabled: Boolean, prioritySort: String): [Wallet!]! - wallet(id: ID!): Wallet - walletByType(type: String!): Wallet walletLogs(type: String, from: String, to: String, cursor: String): WalletLog! failedInvoices: [Invoice!]! } diff --git a/fragments/wallet.js b/fragments/wallet.js index b4d34d30a..ce1090a57 100644 --- a/fragments/wallet.js +++ b/fragments/wallet.js @@ -173,25 +173,6 @@ export const WALLET_FIELDS = gql` } ` -export const WALLET = gql` - ${WALLET_FIELDS} - query Wallet($id: ID!) { - wallet(id: $id) { - ...WalletFields - } - } -` - -// XXX [WALLET] this needs to be updated if another server wallet is added -export const WALLET_BY_TYPE = gql` - ${WALLET_FIELDS} - query WalletByType($type: String!) { - walletByType(type: $type) { - ...WalletFields - } - } -` - export const WALLETS = gql` ${WALLET_FIELDS} query Wallets { From 66200a6a3d7527d07faf0e68effb9d695e97dc9e Mon Sep 17 00:00:00 2001 From: ekzyis Date: Tue, 15 Apr 2025 21:45:43 +0200 Subject: [PATCH 2/2] Remove unused wallet resolver args --- api/typeDefs/wallet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/typeDefs/wallet.js b/api/typeDefs/wallet.js index fbbc9dc30..fa8e6a6c6 100644 --- a/api/typeDefs/wallet.js +++ b/api/typeDefs/wallet.js @@ -68,7 +68,7 @@ const typeDefs = ` numBolt11s: Int! connectAddress: String! walletHistory(cursor: String, inc: String): History - wallets(includeReceivers: Boolean, includeSenders: Boolean, onlyEnabled: Boolean, prioritySort: String): [Wallet!]! + wallets: [Wallet!]! walletLogs(type: String, from: String, to: String, cursor: String): WalletLog! failedInvoices: [Invoice!]! }