This is an interesting corner. I suspect the reason why line numbering hasn’t come up much is because we built error indications into Observable that show the little red error caret inline, on the correct line and usually also the character position. So with few exceptions, there isn’t the need to track down a line by number.
The thing about line numbers in this case is that they wouldn’t directly point to the error: the GraphQL template tag calculates line numbers versus the template string itself - so if const query = is on the second line, the line numbers it reports will be off by 1. I suspect that the best long term solution (though not the simple one) would be to implement this as a cell type / preprocessor type, so that GraphQL query parsing can happen at a lower level and report line numbers (and, maybe, have fancy syntax highlighting). That way we can provide the same kind of inline & line-level error information as we do for JavaScript syntax errors, and avoid adding a configuration option or another default UI element with line numbers.
I was wondering about that, because I haven’t seen that caret in quite a while. Is it limited to certain types of errors? Perhaps someone could share a notebook and screenshot so that I can try to replicate it on my end?