-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request clarification for Directives and Field Selection Merging #531
Comments
I believe that according to the current spec, queries in all cases are correct.
I think it is highly depends on the specific directive and its semantics. Also I think it is not quite accurate to refer to the directive interpretation process as "merging". So far, on a query side spec defines only |
Thanks for the explanation! I was definitely thinking about this the wrong way before. |
Hi, I am in the process of development a server side GraphQL library for PHP. Can I ask for more clarification on this subject? How should the following queries behave?
Or even more complex:
If the directives are left out, fields get correctly merged and its completely correct and simple query. I always thought that field merging occurs before the query execution to get final field lists with all the information necessary for execution (type condition, directives to execute, ...), also |
Under "Validation": "Field Selection Merging", the spec says that merging of fields is only valid when they have identical field names and arguments. However, I don't see anywhere where it addresses what to do about directives.
For each of the following, is the query valid? If so, how should it be interpreted after merging?
Case 1: one field has a directive and the other does not
Case 2: both fields have the same directive
Case 3: both fields have the same directive, but with different arguments
Case 4: each field has different directives
Case 5: each field has the same directives but in different orders
I recognize that the answers may depend on the outcomes of several pending RFCs:
@skip
,@include
and@deprecated
directives #471 [RFC] Repeatable directives #472 might affect cases 2, 3, 4, and 5The text was updated successfully, but these errors were encountered: