Skip to content

Commit

Permalink
refactor(backend): fetch incoming tokens in getPeer
Browse files Browse the repository at this point in the history
  • Loading branch information
furkan-bilgin committed Sep 2, 2024
1 parent e20228f commit 9396d96
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 2 deletions.
3 changes: 3 additions & 0 deletions localenv/mock-account-servicing-entity/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions packages/backend/src/graphql/generated/graphql.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/backend/src/graphql/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/backend/src/graphql/resolvers/peer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const peerToGraphql = (peer: Peer): SchemaPeer => ({
id: peer.id,
maxPacketAmount: peer.maxPacketAmount,
http: peer.http,
incomingTokens: peer.incomingTokens?.map(incomingToken => incomingToken.token),
asset: assetToGraphql(peer.asset),
staticIlpAddress: peer.staticIlpAddress,
name: peer.name,
Expand Down
2 changes: 2 additions & 0 deletions packages/backend/src/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ type Peer implements Model {
maxPacketAmount: UInt64
"Peering connection details"
http: Http!
"Incoming tokens"
incomingTokens: [String!]
"Asset of peering relationship"
asset: Asset!
"Peer's ILP address"
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/payment-method/ilp/peer/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async function getPeer(
deps: ServiceDependencies,
id: string
): Promise<Peer | undefined> {
return Peer.query(deps.knex).findById(id).withGraphFetched('asset')
return Peer.query(deps.knex).findById(id).withGraphFetched('asset').withGraphFetched('incomingTokens')
}

async function createPeer(
Expand Down
5 changes: 4 additions & 1 deletion packages/frontend/app/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/frontend/app/lib/api/peer.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const getPeer = async (args: QueryPeerArgs) => {
authToken
}
}
incomingTokens
}
}
`,
Expand Down
3 changes: 3 additions & 0 deletions packages/mock-account-service-lib/src/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/integration/lib/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9396d96

Please sign in to comment.