...

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

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

     1- name: no fragments
     2  rule: UniqueFragmentNames
     3  schema: 0
     4  query: |2-
     5          
     6          {
     7            field
     8          }
     9          
    10  errors: []
    11- name: one fragment
    12  rule: UniqueFragmentNames
    13  schema: 0
    14  query: |2-
    15          
    16          {
    17            ...fragA
    18          }
    19          
    20          fragment fragA on Type {
    21            field
    22          }
    23          
    24  errors: []
    25- name: many fragments
    26  rule: UniqueFragmentNames
    27  schema: 0
    28  query: |2-
    29          
    30          {
    31            ...fragA
    32            ...fragB
    33            ...fragC
    34          }
    35          fragment fragA on Type {
    36            fieldA
    37          }
    38          fragment fragB on Type {
    39            fieldB
    40          }
    41          fragment fragC on Type {
    42            fieldC
    43          }
    44          
    45  errors: []
    46- name: inline fragments are always unique
    47  rule: UniqueFragmentNames
    48  schema: 0
    49  query: |2-
    50          
    51          {
    52            ...on Type {
    53              fieldA
    54            }
    55            ...on Type {
    56              fieldB
    57            }
    58          }
    59          
    60  errors: []
    61- name: fragment and operation named the same
    62  rule: UniqueFragmentNames
    63  schema: 0
    64  query: |2-
    65          
    66          query Foo {
    67            ...Foo
    68          }
    69          fragment Foo on Type {
    70            field
    71          }
    72          
    73  errors: []
    74- name: fragments named the same
    75  rule: UniqueFragmentNames
    76  schema: 0
    77  query: |2-
    78          
    79          {
    80            ...fragA
    81          }
    82          fragment fragA on Type {
    83            fieldA
    84          }
    85          fragment fragA on Type {
    86            fieldB
    87          }
    88          
    89  errors:
    90    - message: There can be only one fragment named "fragA".
    91      locations:
    92        - {line: 5, column: 16}
    93        - {line: 8, column: 16}
    94- name: fragments named the same without being referenced
    95  rule: UniqueFragmentNames
    96  schema: 0
    97  query: |2-
    98          
    99          fragment fragA on Type {
   100            fieldA
   101          }
   102          fragment fragA on Type {
   103            fieldB
   104          }
   105          
   106  errors:
   107    - message: There can be only one fragment named "fragA".
   108      locations:
   109        - {line: 2, column: 16}
   110        - {line: 5, column: 16}

View as plain text