I would love it if there was some way to format the input in your query to indicate it's an additional scope so the code editor doesn't indicate errors whenever I edit my app.
I can look past the red squiggly in the editor, but the errors in my debug console are harder to ignore.
Editor:
Debug console:
@victoria Am I doing something wrong or are the errors part of cost of doing business with additional scope?
Hey @awilly! You're not doing anything wrong This is unfortunately the cost of doing business with additional scope, *but* we're working on addressing this now!
Thanks for the response! Glad to hear you have a something in the works. It's a minor thing (the debug errors), but I spent alot of time looking at it.
Definitely valid. Thank you for your understanding while we work on improving this behavior!
Didn't forget about this request! We should have some exciting updates to share here soon
Also interested in resolving this. Looking forward to the update, thanks for your work!
Hey @MaximeD! This should have been fixed in Cloud as of Nov 7 '23, and fixed in Self Hosted on the 3.22 release. Are you still seeing this bug on cloud?
Hi Victoria, thanks for the update!
It looks like it's not fixed here (cloud version). I see it on two levels :
-
When defining explicit additional scope, it still shows as a linting error in the console, although the code runs fine.
-
As described by @kindredAsaf, when defining input for a query
Thanks for your help!
As @MaximeD hinted at, the Additional Scope declaration property is not available in GUI mode queries.
In fact it appears to also be missing from Import from Query Library and REST queries.
Good start though, I am slowly updating my queries as I touch them.
Thank you for the screenshots and clear summaries, @MaximeD and @bradlymathews! Filed a report for improper linting patterns in GUI mode, Imported from Query Library and REST queries.
+1 on this one
Still open?
Is there any solution for this yet?
still no solution for this??? Shocking as this thread is almost 3 years old. I am using GUI but I supply the additionalScope using js yet i have the linting issue.
Hey @JasperCreationss - the option to define Additional scope
variables still isn't available in GUI mode, if that's what you're asking, but I'll bump the internal conversations where we're tracking such requests.
Just to clarify—while it's true additionalScope isn't natively supported in GUI mode, there is a workaround that works reliably:
-
Start by switching the query to SQL mode.
-
Define the variable name you'd like to use in the Additional Scope field.
-
Then switch back to GUI mode.
-
Finally, trigger the query from a JS query using additionalScope, making sure to pass in the same variable name you defined earlier.
The only issue is that this method causes a red lint warning in the editor since GUI mode doesn’t officially recognize additionalScope variables.
Hope this helps others looking for the same functionality—just needs a fix on the linting side now!
That's a good distinction, @JasperCreationss - thanks for clarifying and for sharing that workaround!
Perhaps I'm not understanding some detail in this thread so far ... everyone seems to say to define additional Scope variables explicitly ... which I'm doing, but all of them still show up in the "Linting" console, which doesn't make a lot of sense. Here's an example of a JS query (same is happening for REST queries):
Am I doing something wrong or is this is the same issue others are mentioning here?
You're not doing anything wrong, @Annie_Ellenberger! This is the behavior that others are describing. I've updated the internal bug report and will provide an update here as soon as I can.