Skip to content

Commit

Permalink
fix: fetch experiment data
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bedon committed May 30, 2024
1 parent 9eff120 commit 872ce4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/graphql/query/strategicPartnerLoginInfoByPageId.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ query StrategicPartnerLoginInfoByPageId($pageId: String!) {
partnerName
validDomains
}
experiment(id: "opt_in_comms") @client {
id
version
}
}
3 changes: 2 additions & 1 deletion src/pages/LoginAndRegister/RegisterSocial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ import strategicPartnerLoginInfoByPageIdQuery from '@/graphql/query/strategicPar
import experimentVersionFragment from '@/graphql/fragments/experimentVersion.graphql';
import { trackExperimentVersion } from '@/util/experiment/experimentUtils';
import UserUpdatesPreference from '@/components/Checkout/UserUpdatesPreference';
import experimentQuery from '@/graphql/query/experimentAssignment.graphql';
import KvButton from '~/@kiva/kv-components/vue/KvButton';
const COMMS_OPT_IN_EXP_KEY = 'opt_in_comms';
Expand Down Expand Up @@ -339,7 +340,7 @@ export default {
preFetch(config, client, { route }) {
const pageId = route?.query?.partnerContentId;
if (!pageId) {
return Promise.resolve();
return client.query({ query: experimentQuery, variables: { id: COMMS_OPT_IN_EXP_KEY } });
}
return client.query({
query: strategicPartnerLoginInfoByPageIdQuery,
Expand Down

0 comments on commit 872ce4d

Please sign in to comment.