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
If a dataset is set to private and no/empty API key is given to createClient, the query will silently return null instead of erroring which is confusing and makes it hard to track down the problem, especially for new users.
For example, in the following case it's possible for SANITY_API_TOKEN to be undefined in the environment:
I understand it might be a security concern to report a failure to access a project or dataset, but on a recent project I've wasted quite a lot of time tracking the issue down, so a hint would be good. Maybe an error if undefined or null is explicitly passed to createClient?
The text was updated successfully, but these errors were encountered:
If a dataset is set to private and no/empty API key is given to
createClient
, the query will silently returnnull
instead of erroring which is confusing and makes it hard to track down the problem, especially for new users.For example, in the following case it's possible for
SANITY_API_TOKEN
to be undefined in the environment:If a query is made, the result will be null:
I understand it might be a security concern to report a failure to access a project or dataset, but on a recent project I've wasted quite a lot of time tracking the issue down, so a hint would be good. Maybe an error if
undefined
ornull
is explicitly passed tocreateClient
?The text was updated successfully, but these errors were encountered: