additionalScope is becoming null in query

Hey @DaveMeehan! You might actually need to use groups/{{typeof groupName === 'undefined' ? '' : groupName}}.

What happens is that, if the query is called without using additionalScope then the expression inside {{}} will throw a ReferenceError (which is why the linter complains). Whenever a transformer errors it returns null by default, so what you're seeing is that each of those expressions is throwing the same error when trying to evaluate groupName. Using typeof to check whether or not a variable has been defined is a workaround for that, you can read more about here, but it requires that you check that the type is undefined instead of null :sweat_smile:

2 Likes