...

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

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

     1- name: single arg is known
     2  rule: KnownArgumentNames
     3  schema: 0
     4  query: |2-
     5          
     6          fragment argOnRequiredArg on Dog {
     7            doesKnowCommand(dogCommand: SIT)
     8          }
     9          
    10  errors: []
    11- name: multiple args are known
    12  rule: KnownArgumentNames
    13  schema: 0
    14  query: |2-
    15          
    16          fragment multipleArgs on ComplicatedArgs {
    17            multipleReqs(req1: 1, req2: 2)
    18          }
    19          
    20  errors: []
    21- name: ignores args of unknown fields
    22  rule: KnownArgumentNames
    23  schema: 0
    24  query: |2-
    25          
    26          fragment argOnUnknownField on Dog {
    27            unknownField(unknownArg: SIT)
    28          }
    29          
    30  errors: []
    31- name: multiple args in reverse order are known
    32  rule: KnownArgumentNames
    33  schema: 0
    34  query: |2-
    35          
    36          fragment multipleArgsReverseOrder on ComplicatedArgs {
    37            multipleReqs(req2: 2, req1: 1)
    38          }
    39          
    40  errors: []
    41- name: no args on optional arg
    42  rule: KnownArgumentNames
    43  schema: 0
    44  query: |2-
    45          
    46          fragment noArgOnOptionalArg on Dog {
    47            isHousetrained
    48          }
    49          
    50  errors: []
    51- name: args are known deeply
    52  rule: KnownArgumentNames
    53  schema: 0
    54  query: |2-
    55          
    56          {
    57            dog {
    58              doesKnowCommand(dogCommand: SIT)
    59            }
    60            human {
    61              pet {
    62                ... on Dog {
    63                  doesKnowCommand(dogCommand: SIT)
    64                }
    65              }
    66            }
    67          }
    68          
    69  errors: []
    70- name: directive args are known
    71  rule: KnownArgumentNames
    72  schema: 0
    73  query: |2-
    74          
    75          {
    76            dog @skip(if: true)
    77          }
    78          
    79  errors: []
    80- name: undirective args are invalid
    81  rule: KnownArgumentNames
    82  schema: 0
    83  query: |2-
    84          
    85          {
    86            dog @skip(unless: true)
    87          }
    88          
    89  errors:
    90    - message: Unknown argument "unless" on directive "@skip".
    91      locations:
    92        - {line: 3, column: 19}
    93- name: misspelled directive args are reported
    94  rule: KnownArgumentNames
    95  schema: 0
    96  query: |2-
    97          
    98          {
    99            dog @skip(iff: true)
   100          }
   101          
   102  errors:
   103    - message: Unknown argument "iff" on directive "@skip". Did you mean "if"?
   104      locations:
   105        - {line: 3, column: 19}
   106- name: invalid arg name
   107  rule: KnownArgumentNames
   108  schema: 0
   109  query: |2-
   110          
   111          fragment invalidArgName on Dog {
   112            doesKnowCommand(unknown: true)
   113          }
   114          
   115  errors:
   116    - message: Unknown argument "unknown" on field "doesKnowCommand" of type "Dog".
   117      locations:
   118        - {line: 3, column: 25}
   119- name: misspelled arg name is reported
   120  rule: KnownArgumentNames
   121  schema: 0
   122  query: |2-
   123          
   124          fragment invalidArgName on Dog {
   125            doesKnowCommand(dogcommand: true)
   126          }
   127          
   128  errors:
   129    - message: Unknown argument "dogcommand" on field "doesKnowCommand" of type "Dog". Did you mean "dogCommand"?
   130      locations:
   131        - {line: 3, column: 25}
   132- name: unknown args amongst known args
   133  rule: KnownArgumentNames
   134  schema: 0
   135  query: |2-
   136          
   137          fragment oneGoodArgOneInvalidArg on Dog {
   138            doesKnowCommand(whoknows: 1, dogCommand: SIT, unknown: true)
   139          }
   140          
   141  errors:
   142    - message: Unknown argument "whoknows" on field "doesKnowCommand" of type "Dog".
   143      locations:
   144        - {line: 3, column: 25}
   145    - message: Unknown argument "unknown" on field "doesKnowCommand" of type "Dog".
   146      locations:
   147        - {line: 3, column: 55}
   148- name: unknown args deeply
   149  rule: KnownArgumentNames
   150  schema: 0
   151  query: |2-
   152          
   153          {
   154            dog {
   155              doesKnowCommand(unknown: true)
   156            }
   157            human {
   158              pet {
   159                ... on Dog {
   160                  doesKnowCommand(unknown: true)
   161                }
   162              }
   163            }
   164          }
   165          
   166  errors:
   167    - message: Unknown argument "unknown" on field "doesKnowCommand" of type "Dog".
   168      locations:
   169        - {line: 4, column: 27}
   170    - message: Unknown argument "unknown" on field "doesKnowCommand" of type "Dog".
   171      locations:
   172        - {line: 9, column: 31}

View as plain text