make sure to push sanity init on the master branch otherwise folder wont be there
to get sanity url: cd into sanity subfolder in project, sanity graphql deploy
sanity fetch:
> post, same headers as REST APIs
> body: JSON.stringify({query: sanityQuery})
> const {data} = await response.json()
> sanityData = data
Objects:
access object items with dot notation: parent.objectName
access object items with [] notation: parent['property name'] usually only when property name is an unknown variable passed, or is a string with a space in it.
HTML/CSS:
if you want to hide images before they load, need to use class="hidden"
img.hidden {opacity: 0}, after await fetch from sanity, .classList.remove('hidden')
GraphQL
sanity init
on the master branch otherwise folder wont be theresanity graphql deploy
Objects:
parent.objectName
parent['property name']
usually only when property name is an unknown variable passed, or is a string with a space in it.HTML/CSS: