Skip to content

Instantly share code, notes, and snippets.

@tannerlinsley
Created April 21, 2020 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tannerlinsley/156ce85a4e68c7956cc473040c81b395 to your computer and use it in GitHub Desktop.
Save tannerlinsley/156ce85a4e68c7956cc473040c81b395 to your computer and use it in GitHub Desktop.
function useSetUserData() {
const [mutateUserData] = useMutation(setAirtableFields, {
onMutate: () => {
queryCache.setQueryData(Auth0, undefined)
},
// After success or failure, refetch the user query
onSettled: () => queryCache.refetchQueries(Auth0),
})
return [mutateUserData]
}
export { useUserData, useSetUserData }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment