mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Updating the cache with data from the fragment
This commit is contained in:
@@ -46,7 +46,7 @@ ProfileContainer.propTypes = {
|
||||
currentUser: PropTypes.object,
|
||||
};
|
||||
|
||||
const slots = ['profileSections'];
|
||||
const slots = ['profileSections', 'profileSettings', 'profileHeader'];
|
||||
|
||||
const withProfileQuery = withQuery(
|
||||
gql`
|
||||
|
||||
@@ -336,6 +336,29 @@ export const withUpdateEmailAddress = withMutation(
|
||||
variables: {
|
||||
input,
|
||||
},
|
||||
update: proxy => {
|
||||
const UpdateEmailAddressQuery = gql`
|
||||
query Talk_UpdateEmailAddress {
|
||||
me {
|
||||
id
|
||||
email
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const prev = proxy.readQuery({ query: UpdateEmailAddressQuery });
|
||||
|
||||
const data = update(prev, {
|
||||
me: {
|
||||
email: { $set: input.email },
|
||||
},
|
||||
});
|
||||
|
||||
proxy.writeQuery({
|
||||
query: UpdateEmailAddressQuery,
|
||||
data,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user