Reject directives within fields
arg of @key
, @provides
and @requires
#1975
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed that we accepting (parsing) directive applications with a
@key
,@provide
or@requires
, but were silently ignoring it. In other words:was accepted, but the
@skip
was completely ignored. Of course, it's unclear why would anyone write this, but it still imo qualify as a bug that we silently ignore this since the code essentially do not do what is written. It's certainly an oversight.More generally, as we don't anything with any such directive applications, and for user/custom directives, there is no way to provide any processing whatsoever, so overall, I think we should just reject any directive applications to avoid any risk of confusion, and this is what the patch does.
I'll further note that:
@skip
is a bit arbitrary when you need a hard-codedtrue
orfalse
for theif
: why would you ever write this? But the context here is actually Deliver: @defer support in the query planner #1921: someone could want to try to see what a@defer
does within afields
value, and we should be clear it just doesn't work.