...

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

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

     1- name: of the same object
     2  rule: PossibleFragmentSpreads
     3  schema: 14
     4  query: |2-
     5
     6          fragment objectWithinObject on Dog { ...dogFragment }
     7          fragment dogFragment on Dog { barkVolume }
     8
     9  errors: []
    10- name: of the same object with inline fragment
    11  rule: PossibleFragmentSpreads
    12  schema: 14
    13  query: |2-
    14
    15          fragment objectWithinObjectAnon on Dog { ... on Dog { barkVolume } }
    16
    17  errors: []
    18- name: object into an implemented interface
    19  rule: PossibleFragmentSpreads
    20  schema: 14
    21  query: |2-
    22
    23          fragment objectWithinInterface on Pet { ...dogFragment }
    24          fragment dogFragment on Dog { barkVolume }
    25
    26  errors: []
    27- name: object into containing union
    28  rule: PossibleFragmentSpreads
    29  schema: 14
    30  query: |2-
    31
    32          fragment objectWithinUnion on CatOrDog { ...dogFragment }
    33          fragment dogFragment on Dog { barkVolume }
    34
    35  errors: []
    36- name: union into contained object
    37  rule: PossibleFragmentSpreads
    38  schema: 14
    39  query: |2-
    40
    41          fragment unionWithinObject on Dog { ...catOrDogFragment }
    42          fragment catOrDogFragment on CatOrDog { __typename }
    43
    44  errors: []
    45- name: union into overlapping interface
    46  rule: PossibleFragmentSpreads
    47  schema: 14
    48  query: |2-
    49
    50          fragment unionWithinInterface on Pet { ...catOrDogFragment }
    51          fragment catOrDogFragment on CatOrDog { __typename }
    52
    53  errors: []
    54- name: union into overlapping union
    55  rule: PossibleFragmentSpreads
    56  schema: 14
    57  query: |2-
    58
    59          fragment unionWithinUnion on DogOrHuman { ...catOrDogFragment }
    60          fragment catOrDogFragment on CatOrDog { __typename }
    61
    62  errors: []
    63- name: interface into implemented object
    64  rule: PossibleFragmentSpreads
    65  schema: 14
    66  query: |2-
    67
    68          fragment interfaceWithinObject on Dog { ...petFragment }
    69          fragment petFragment on Pet { name }
    70
    71  errors: []
    72- name: interface into overlapping interface
    73  rule: PossibleFragmentSpreads
    74  schema: 14
    75  query: |2-
    76
    77          fragment interfaceWithinInterface on Pet { ...beingFragment }
    78          fragment beingFragment on Being { name }
    79
    80  errors: []
    81- name: interface into overlapping interface in inline fragment
    82  rule: PossibleFragmentSpreads
    83  schema: 14
    84  query: |2-
    85
    86          fragment interfaceWithinInterface on Pet { ... on Being { name } }
    87
    88  errors: []
    89- name: interface into overlapping union
    90  rule: PossibleFragmentSpreads
    91  schema: 14
    92  query: |2-
    93
    94          fragment interfaceWithinUnion on CatOrDog { ...petFragment }
    95          fragment petFragment on Pet { name }
    96
    97  errors: []
    98- name: ignores incorrect type (caught by FragmentsOnCompositeTypesRule)
    99  rule: PossibleFragmentSpreads
   100  schema: 14
   101  query: |2-
   102
   103          fragment petFragment on Pet { ...badInADifferentWay }
   104          fragment badInADifferentWay on String { name }
   105
   106  errors: []
   107- name: ignores unknown fragments (caught by KnownFragmentNamesRule)
   108  rule: PossibleFragmentSpreads
   109  schema: 14
   110  query: |2-
   111
   112          fragment petFragment on Pet { ...UnknownFragment }
   113
   114  errors: []
   115- name: different object into object
   116  rule: PossibleFragmentSpreads
   117  schema: 14
   118  query: |2-
   119
   120          fragment invalidObjectWithinObject on Cat { ...dogFragment }
   121          fragment dogFragment on Dog { barkVolume }
   122
   123  errors:
   124    - message: Fragment "dogFragment" cannot be spread here as objects of type "Cat" can never be of type "Dog".
   125      locations:
   126        - {line: 2, column: 51}
   127- name: different object into object in inline fragment
   128  rule: PossibleFragmentSpreads
   129  schema: 14
   130  query: |2-
   131
   132          fragment invalidObjectWithinObjectAnon on Cat {
   133            ... on Dog { barkVolume }
   134          }
   135
   136  errors:
   137    - message: Fragment cannot be spread here as objects of type "Cat" can never be of type "Dog".
   138      locations:
   139        - {line: 3, column: 9}
   140- name: object into not implementing interface
   141  rule: PossibleFragmentSpreads
   142  schema: 14
   143  query: |2-
   144
   145          fragment invalidObjectWithinInterface on Pet { ...humanFragment }
   146          fragment humanFragment on Human { pets { name } }
   147
   148  errors:
   149    - message: Fragment "humanFragment" cannot be spread here as objects of type "Pet" can never be of type "Human".
   150      locations:
   151        - {line: 2, column: 54}
   152- name: object into not containing union
   153  rule: PossibleFragmentSpreads
   154  schema: 14
   155  query: |2-
   156
   157          fragment invalidObjectWithinUnion on CatOrDog { ...humanFragment }
   158          fragment humanFragment on Human { pets { name } }
   159
   160  errors:
   161    - message: Fragment "humanFragment" cannot be spread here as objects of type "CatOrDog" can never be of type "Human".
   162      locations:
   163        - {line: 2, column: 55}
   164- name: union into not contained object
   165  rule: PossibleFragmentSpreads
   166  schema: 14
   167  query: |2-
   168
   169          fragment invalidUnionWithinObject on Human { ...catOrDogFragment }
   170          fragment catOrDogFragment on CatOrDog { __typename }
   171
   172  errors:
   173    - message: Fragment "catOrDogFragment" cannot be spread here as objects of type "Human" can never be of type "CatOrDog".
   174      locations:
   175        - {line: 2, column: 52}
   176- name: union into non overlapping interface
   177  rule: PossibleFragmentSpreads
   178  schema: 14
   179  query: |2-
   180
   181          fragment invalidUnionWithinInterface on Pet { ...humanOrAlienFragment }
   182          fragment humanOrAlienFragment on HumanOrAlien { __typename }
   183
   184  errors:
   185    - message: Fragment "humanOrAlienFragment" cannot be spread here as objects of type "Pet" can never be of type "HumanOrAlien".
   186      locations:
   187        - {line: 2, column: 53}
   188- name: union into non overlapping union
   189  rule: PossibleFragmentSpreads
   190  schema: 14
   191  query: |2-
   192
   193          fragment invalidUnionWithinUnion on CatOrDog { ...humanOrAlienFragment }
   194          fragment humanOrAlienFragment on HumanOrAlien { __typename }
   195
   196  errors:
   197    - message: Fragment "humanOrAlienFragment" cannot be spread here as objects of type "CatOrDog" can never be of type "HumanOrAlien".
   198      locations:
   199        - {line: 2, column: 54}
   200- name: interface into non implementing object
   201  rule: PossibleFragmentSpreads
   202  schema: 14
   203  query: |2-
   204
   205          fragment invalidInterfaceWithinObject on Cat { ...intelligentFragment }
   206          fragment intelligentFragment on Intelligent { iq }
   207
   208  errors:
   209    - message: Fragment "intelligentFragment" cannot be spread here as objects of type "Cat" can never be of type "Intelligent".
   210      locations:
   211        - {line: 2, column: 54}
   212- name: interface into non overlapping interface
   213  rule: PossibleFragmentSpreads
   214  schema: 14
   215  query: |2-
   216
   217          fragment invalidInterfaceWithinInterface on Pet {
   218            ...intelligentFragment
   219          }
   220          fragment intelligentFragment on Intelligent { iq }
   221
   222  errors:
   223    - message: Fragment "intelligentFragment" cannot be spread here as objects of type "Pet" can never be of type "Intelligent".
   224      locations:
   225        - {line: 3, column: 9}
   226- name: interface into non overlapping interface in inline fragment
   227  rule: PossibleFragmentSpreads
   228  schema: 14
   229  query: |2-
   230
   231          fragment invalidInterfaceWithinInterfaceAnon on Pet {
   232            ...on Intelligent { iq }
   233          }
   234
   235  errors:
   236    - message: Fragment cannot be spread here as objects of type "Pet" can never be of type "Intelligent".
   237      locations:
   238        - {line: 3, column: 9}
   239- name: interface into non overlapping union
   240  rule: PossibleFragmentSpreads
   241  schema: 14
   242  query: |2-
   243
   244          fragment invalidInterfaceWithinUnion on HumanOrAlien { ...petFragment }
   245          fragment petFragment on Pet { name }
   246
   247  errors:
   248    - message: Fragment "petFragment" cannot be spread here as objects of type "HumanOrAlien" can never be of type "Pet".
   249      locations:
   250        - {line: 2, column: 62}

View as plain text