From ef881d94cd55d927f0c65a1da9d5a94452caf9d1 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 16 Jun 2022 14:34:30 +0200 Subject: [PATCH] load contribution link and transaction link --- frontend/src/graphql/queries.js | 40 +++++++++++++++++++------- frontend/src/pages/TransactionLink.vue | 1 + frontend/src/plugins/apolloProvider.js | 6 +++- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 601880a51..8f1c4e331 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -114,17 +114,35 @@ export const queryOptIn = gql` export const queryTransactionLink = gql` query($code: String!) { queryTransactionLink(code: $code) { - id - amount - memo - createdAt - validUntil - redeemedAt - deletedAt - user { - firstName - publisherId - email + LinkType { + ... on TransactionLink { + id + amount + memo + createdAt + validUntil + redeemedAt + deletedAt + user { + firstName + publisherId + email + } + } + ... on ContributionLink { + id + validTo + validFrom + amount + name + memo + cycle + createdAt + code + link + deletedAt + maxAmountPerMonth + } } } } diff --git a/frontend/src/pages/TransactionLink.vue b/frontend/src/pages/TransactionLink.vue index 8bf095240..a62453c64 100644 --- a/frontend/src/pages/TransactionLink.vue +++ b/frontend/src/pages/TransactionLink.vue @@ -62,6 +62,7 @@ export default { }, }) .then((result) => { + console.log(result) this.linkData = result.data.queryTransactionLink }) .catch((err) => { diff --git a/frontend/src/plugins/apolloProvider.js b/frontend/src/plugins/apolloProvider.js index 73452e5ba..adf9f180a 100644 --- a/frontend/src/plugins/apolloProvider.js +++ b/frontend/src/plugins/apolloProvider.js @@ -29,7 +29,11 @@ const authLink = new ApolloLink((operation, forward) => { const apolloClient = new ApolloClient({ link: authLink.concat(httpLink), - cache: new InMemoryCache(), + cache: new InMemoryCache({ + possibleTypes: { + LinkType: ['TransactionLink', 'ContributionLink'], + }, + }), }) export const apolloProvider = new VueApollo({