...

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

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

     1- name: valid scalar selection
     2  rule: ScalarLeafs
     3  schema: 0
     4  query: |2-
     5          
     6          fragment scalarSelection on Dog {
     7            barks
     8          }
     9          
    10  errors: []
    11- name: object type missing selection
    12  rule: ScalarLeafs
    13  schema: 0
    14  query: |2-
    15          
    16          query directQueryOnObjectWithoutSubFields {
    17            human
    18          }
    19          
    20  errors:
    21    - message: 'Field "human" of type "Human" must have a selection of subfields. Did you mean "human { ... }"?'
    22      locations:
    23        - {line: 3, column: 9}
    24- name: interface type missing selection
    25  rule: ScalarLeafs
    26  schema: 0
    27  query: |2-
    28          
    29          {
    30            human { pets }
    31          }
    32          
    33  errors:
    34    - message: 'Field "pets" of type "[Pet]" must have a selection of subfields. Did you mean "pets { ... }"?'
    35      locations:
    36        - {line: 3, column: 17}
    37- name: valid scalar selection with args
    38  rule: ScalarLeafs
    39  schema: 0
    40  query: |2-
    41          
    42          fragment scalarSelectionWithArgs on Dog {
    43            doesKnowCommand(dogCommand: SIT)
    44          }
    45          
    46  errors: []
    47- name: scalar selection not allowed on Boolean
    48  rule: ScalarLeafs
    49  schema: 0
    50  query: |2-
    51          
    52          fragment scalarSelectionsNotAllowedOnBoolean on Dog {
    53            barks { sinceWhen }
    54          }
    55          
    56  errors:
    57    - message: Field "barks" must not have a selection since type "Boolean" has no subfields.
    58      locations:
    59        - {line: 3, column: 15}
    60- name: scalar selection not allowed on Enum
    61  rule: ScalarLeafs
    62  schema: 0
    63  query: |2-
    64          
    65          fragment scalarSelectionsNotAllowedOnEnum on Cat {
    66            furColor { inHexdec }
    67          }
    68          
    69  errors:
    70    - message: Field "furColor" must not have a selection since type "FurColor" has no subfields.
    71      locations:
    72        - {line: 3, column: 18}
    73- name: scalar selection not allowed with args
    74  rule: ScalarLeafs
    75  schema: 0
    76  query: |2-
    77          
    78          fragment scalarSelectionsNotAllowedWithArgs on Dog {
    79            doesKnowCommand(dogCommand: SIT) { sinceWhen }
    80          }
    81          
    82  errors:
    83    - message: Field "doesKnowCommand" must not have a selection since type "Boolean" has no subfields.
    84      locations:
    85        - {line: 3, column: 42}
    86- name: Scalar selection not allowed with directives
    87  rule: ScalarLeafs
    88  schema: 0
    89  query: |2-
    90          
    91          fragment scalarSelectionsNotAllowedWithDirectives on Dog {
    92            name @include(if: true) { isAlsoHumanName }
    93          }
    94          
    95  errors:
    96    - message: Field "name" must not have a selection since type "String" has no subfields.
    97      locations:
    98        - {line: 3, column: 33}
    99- name: Scalar selection not allowed with directives and args
   100  rule: ScalarLeafs
   101  schema: 0
   102  query: |2-
   103          
   104          fragment scalarSelectionsNotAllowedWithDirectivesAndArgs on Dog {
   105            doesKnowCommand(dogCommand: SIT) @include(if: true) { sinceWhen }
   106          }
   107          
   108  errors:
   109    - message: Field "doesKnowCommand" must not have a selection since type "Boolean" has no subfields.
   110      locations:
   111        - {line: 3, column: 61}

View as plain text