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
Take a look at useBalance hook. It requires a denom to be defined, but what the denom isn't statically available and it's a subject of a fetch? In other words, how do I use the hook if denom isn't yet defined?
Turns out graz doesn't support undefined arguments, so ALL the queries that depend on statically known arguments are not usable in such cases.
...
Describe the solution you'd like
wagmi supports undefined arguments in queries as they have a common query hook input interface of {args:Something[] | undefined}.
However, an array is used in their case as they dynamically retrieve the type of the query from ABI, which is not the case for graz.
As an opposite, for such hooks, graz has to either support undefineable arguments { something: Type | undefined } to enforce a user to pass some value which might be undefined as opposed to passing { something?: Type } which would make an argument partial and would confuse the developer wether he has passed sufficient input or not.
Therefore queries have to check for the input to be sufficient, and unless it is, return undefined and never enable the query.
Another approach could involve a breaking change and defining a common interface of { args: Input | undefined } that could simplify the input checking for graz developers, but that is probably would not be considered.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
https://graz.sh/docs/hooks/useBalance
Take a look at
useBalance
hook. It requires adenom
to be defined, but what thedenom
isn't statically available and it's a subject of a fetch? In other words, how do I use the hook ifdenom
isn't yet defined?Turns out
graz
doesn't support undefined arguments, so ALL the queries that depend on statically known arguments are not usable in such cases....
Describe the solution you'd like
wagmi
supports undefined arguments in queries as they have a common query hook input interface of{args:Something[] | undefined}
.However, an array is used in their case as they dynamically retrieve the type of the query from ABI, which is not the case for graz.
As an opposite, for such hooks, graz has to either support undefineable arguments
{ something: Type | undefined }
to enforce a user to pass some value which might be undefined as opposed to passing{ something?: Type }
which would make an argument partial and would confuse the developer wether he has passed sufficient input or not.Therefore queries have to check for the input to be sufficient, and unless it is, return undefined and never enable the query.
Another approach could involve a breaking change and defining a common interface of
{ args: Input | undefined }
that could simplify the input checking for graz developers, but that is probably would not be considered.The text was updated successfully, but these errors were encountered: