...

Text file src/github.com/vektah/gqlparser/validator/imported/spec/UniqueInputFieldNames.spec.yml

Documentation: github.com/vektah/gqlparser/validator/imported/spec

     1- name: input object with fields
     2  rule: UniqueInputFieldNames
     3  schema: 0
     4  query: |2-
     5          
     6          {
     7            field(arg: { f: true })
     8          }
     9          
    10  errors: []
    11- name: same input object within two args
    12  rule: UniqueInputFieldNames
    13  schema: 0
    14  query: |2-
    15          
    16          {
    17            field(arg1: { f: true }, arg2: { f: true })
    18          }
    19          
    20  errors: []
    21- name: multiple input object fields
    22  rule: UniqueInputFieldNames
    23  schema: 0
    24  query: |2-
    25          
    26          {
    27            field(arg: { f1: "value", f2: "value", f3: "value" })
    28          }
    29          
    30  errors: []
    31- name: allows for nested input objects with similar fields
    32  rule: UniqueInputFieldNames
    33  schema: 0
    34  query: |2-
    35          
    36          {
    37            field(arg: {
    38              deep: {
    39                deep: {
    40                  id: 1
    41                }
    42                id: 1
    43              }
    44              id: 1
    45            })
    46          }
    47          
    48  errors: []
    49- name: duplicate input object fields
    50  rule: UniqueInputFieldNames
    51  schema: 0
    52  query: |2-
    53          
    54          {
    55            field(arg: { f1: "value", f1: "value" })
    56          }
    57          
    58  errors:
    59    - message: There can be only one input field named "f1".
    60      locations:
    61        - {line: 3, column: 22}
    62        - {line: 3, column: 35}
    63- name: many duplicate input object fields
    64  rule: UniqueInputFieldNames
    65  schema: 0
    66  query: |2-
    67          
    68          {
    69            field(arg: { f1: "value", f1: "value", f1: "value" })
    70          }
    71          
    72  errors:
    73    - message: There can be only one input field named "f1".
    74      locations:
    75        - {line: 3, column: 22}
    76        - {line: 3, column: 35}
    77    - message: There can be only one input field named "f1".
    78      locations:
    79        - {line: 3, column: 22}
    80        - {line: 3, column: 48}

View as plain text