Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: City-of-Helsinki/open-city-profile-ui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3253f95b6d583b9427568b8a281968bdc023d1e0
Choose a base ref
..
head repository: City-of-Helsinki/open-city-profile-ui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2918602f7904d418515687fb80f479fb93e653bf
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/profile/hooks/useProfileQuery.ts
10 changes: 5 additions & 5 deletions src/profile/hooks/useProfileQuery.ts
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@ type QueryReturnType = {
};

/*
note: there is a bug in Apollo client.
https://github.com/apollographql/apollo-client/issues/5531
onError is triggered only once, unless notifyOnNetworkStatusChange:true.
That will cause unnecessary re-renders on every network status change
so will not use it.
note:
onError is not triggered when errorPolicy === 'all'
If user is logged in with weak authentication, there is always a graphQL error included.
If errorPolicy is 'none', graphQL errors are not allowed. Profile won't load.
If errorPolicy is 'ignore', graphQL errors are not populated and cannot be detected.
Work-around: useEffect will trigger onError when error changes.
*/
export function useProfileQuery(props?: {