diff --git a/packages/peregrine/lib/talons/Checkout/useAddressForm.js b/packages/peregrine/lib/talons/Checkout/useAddressForm.js index 775f463a3d..eec3e1725f 100644 --- a/packages/peregrine/lib/talons/Checkout/useAddressForm.js +++ b/packages/peregrine/lib/talons/Checkout/useAddressForm.js @@ -33,9 +33,12 @@ export const useAddressForm = props => { const [{ isSignedIn }] = useUserContext(); - const [setGuestEmail] = useMutation(setGuestEmailMutation); + const [setGuestEmail] = useMutation(setGuestEmailMutation, { + fetchPolicy: 'no-cache' + }); const [setShippingAddressOnCart] = useMutation( - setShippingAddressOnCartMutation + setShippingAddressOnCartMutation, + { fetchPolicy: 'no-cache' } ); const values = useMemo( () => diff --git a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js index fc1d0a34d8..f5d5863971 100644 --- a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js +++ b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js @@ -39,12 +39,18 @@ export const useCreateAccount = props => { { getUserDetails, setToken } ] = useUserContext(); + const [fetchCartId] = useMutation(createCartMutation); + + // For create account and sign in mutations, we don't want to cache any + // personally identifiable information (PII). So we set fetchPolicy to 'no-cache'. const [createAccount, { error: createAccountError }] = useMutation( - createAccountQuery + createAccountQuery, + { fetchPolicy: 'no-cache' } ); + const [signIn, { error: signInError }] = useMutation(signInMutation, { + fetchPolicy: 'no-cache' + }); - const [fetchCartId] = useMutation(createCartMutation); - const [signIn, { error: signInError }] = useMutation(signInMutation); const fetchUserDetails = useAwaitQuery(customerQuery); const fetchCartDetails = useAwaitQuery(getCartDetailsQuery); diff --git a/packages/peregrine/lib/talons/SignIn/useSignIn.js b/packages/peregrine/lib/talons/SignIn/useSignIn.js index d81f66e7fe..7ca942a29e 100644 --- a/packages/peregrine/lib/talons/SignIn/useSignIn.js +++ b/packages/peregrine/lib/talons/SignIn/useSignIn.js @@ -23,7 +23,9 @@ export const useSignIn = props => { { getUserDetails, setToken } ] = useUserContext(); - const [signIn, { error: signInError }] = useMutation(signInMutation); + const [signIn, { error: signInError }] = useMutation(signInMutation, { + fetchPolicy: 'no-cache' + }); const [fetchCartId] = useMutation(createCartMutation); const fetchUserDetails = useAwaitQuery(customerQuery); const fetchCartDetails = useAwaitQuery(getCartDetailsQuery);