Skip to content

Request clarification for Directives and Field Selection Merging #531

Closed
@nagledb

Description

@nagledb

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

{
  sample {
    text @example
    text
  }
}

Case 2: both fields have the same directive

{
  sample {
    text @example
    text @example
  }
}

Case 3: both fields have the same directive, but with different arguments

{
  sample {
    text @example(arg: 1)
    text @example(arg: 2)
  }
}

Case 4: each field has different directives

{
  sample {
    text @example1
    text @example2
  }
}

Case 5: each field has the same directives but in different orders

{
  sample {
    text @example1 @example2
    text @example2 @example1
  }
}

I recognize that the answers may depend on the outcomes of several pending RFCs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions