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
constgetQuery=(type)=>{if(type==="foo"){returnfooQuery;}if(type==="bar"){returnbarQuery;}returnnull;}// type will eventually get a non-null value, but will initially be nullconstquery=getQuery(type);// skip until the query is determinedconst{ error, loading, data }=useQuery(query,{skip: !query,});
In this example, I don't know what query to use until I have a value for type, therefore the query is skipped until I do.
This worked fine in 3.1.5, but in 3.2.0 I now get this:
Argument of null passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document.
I don't see anything in the release notes documenting this change, so unsure if it was intentional, or a side-effect of something else?
Initially I thought this was the skip issue again as per #6190 (comment), but it seems a little different now?
The text was updated successfully, but these errors were encountered:
MichaelBurgess
changed the title
useQuery argument null exception in 3.2.0 when query is null and skip is true
useQuery argument null exception in 3.2.0 when query is null/undefined and skip is true
Sep 15, 2020
MichaelBurgess
changed the title
useQuery argument null exception in 3.2.0 when query is null/undefined and skip is true
useQuery argument null exception when query is null/undefined and skip is true
Sep 15, 2020
In
3.1.5
I could do something like this:In this example, I don't know what query to use until I have a value for
type
, therefore the query is skipped until I do.This worked fine in
3.1.5
, but in3.2.0
I now get this:Argument of null passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document
.I don't see anything in the release notes documenting this change, so unsure if it was intentional, or a side-effect of something else?
Initially I thought this was the
skip
issue again as per #6190 (comment), but it seems a little different now?The text was updated successfully, but these errors were encountered: