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
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Intended outcome:
The Query component should respect it's own type definitions.
Actual outcome:
The data property from the result parameter of the children function might be defined as an empty object. This goes against the type definitions.
How to reproduce the issue:
The children functions is called with QueryResults<TData, TVariables> as it's first param. According to the QueryResults typings, the result object contain a data property which is typed as TData | undefined.
According to that typing, if data is not undefined, it can only be of TData type. This is not the case. When the children function is called data might be an empty object which doesn't respect it's own typing.
Here is an example of the bug on codesandbox.
Note: to properly see the type checking within codesandbox, you must go to "preferences", and then under "experiments" toggle on the "Use VSCode in the browser" option.
Same thing. It even changes every week or so. Last month the Query behaviour was like you said, then it was changed to never return an {} so I had to fix all Query usages to just check for undefined, and here we go again
Intended outcome:
The
Query
component should respect it's own type definitions.Actual outcome:
The
data
property from the result parameter of the children function might be defined as an empty object. This goes against the type definitions.How to reproduce the issue:
The children functions is called with
QueryResults<TData, TVariables>
as it's first param. According to theQueryResults
typings, the result object contain adata
property which is typed asTData | undefined
.According to that typing, if
data
is not undefined, it can only be ofTData
type. This is not the case. When the children function is calleddata
might be an empty object which doesn't respect it's own typing.Here is an example of the bug on codesandbox.
Note: to properly see the type checking within codesandbox, you must go to "preferences", and then under "experiments" toggle on the "Use VSCode in the browser" option.
Version
The text was updated successfully, but these errors were encountered: