One feature I found very useful when using jq in Bash is the "alternative operator" '//'.
result=$(echo "$data" | jq -r '.optional // ""')
if [[ -n "$result" ]] ...
feels more natural in Bash than result=$(echo "$data" | jq -r '.optional')
if [[ "$result" != null ]] ...
Especially if an empty field should be handled the same way.And when using the raw-output option it helps with the ambiguity between "null" and null.