TypeGen define non-null for singletons in queries #7361
Unanswered
notflip
asked this question in
Sanity Studio Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using the following query to fetch a few singletons
The types of settings, socials and seo are singletons in my Sanity Studio (so they will always be defined)
However when using TypeGen the result is
Each of these items can be null, according to typegen, which causes a lot of if-checks in my vue code. Is there a way to tell TypeGen that these are singletons/always defined?
This is an example of my singleton code for SEO
Beta Was this translation helpful? Give feedback.
All reactions