Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(() => {
const current = {
...ref.current,
rehydrated: true,
error: null
};
const { props } = ref.current;
ref.current = current;
if (!props) forceUpdate(current);
})
.catch(error => {
throw error; //
});
}
const query = useMemoOperationDescriptor(gqlQuery, variables);
const queryFetcher = useQueryFetcher();
const { fetchPolicy, networkCacheConfig, ttl } = options;
const { props, error, ...others } = queryFetcher.execute(
environment,
query,
{
networkCacheConfig,
fetchPolicy:
rehydrated && environment.isOnline() ? fetchPolicy : STORE_ONLY
},
(environment, query) => environment.retain(query.root, { ttl }) // TODO new directive
);