You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
request won't get updated when I call setDynamicGqlTemplate.
It seems request is decorated with useCallback, is this design deliberate?
Intended outcome:
request get updated when dynamic gql template changes.
Actual outcome:
Here is the implementation of useLazyQuery.
constexecute=useCallback<LazyQueryResultTuple<TData,TVariables>[0]>(executeOptions=>{execOptionsRef.current=executeOptions ? {
...executeOptions,fetchPolicy: executeOptions.fetchPolicy||initialFetchPolicy,} : {fetchPolicy: initialFetchPolicy,};constpromise=internalState.asyncUpdate()// Like internalState.forceUpdate, but returns a Promise..then(queryResult=>Object.assign(queryResult,eagerMethods));// Because the return value of `useLazyQuery` is usually floated, we need// to catch the promise to prevent unhandled rejections.promise.catch(()=>{});returnpromise;},[]);
We just released v3.7.11 which now allows you to use dynamic queries. The execute function will now use the most recently passed query document to the hook.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.
request
won't get updated when I call setDynamicGqlTemplate.It seems
request
is decorated withuseCallback
, is this design deliberate?Intended outcome:
request
get updated when dynamic gql template changes.Actual outcome:
Here is the implementation of useLazyQuery.
see useLazyQuery.ts#74
How to reproduce the issue:
see above.
Versions
3.7.0
The text was updated successfully, but these errors were encountered: