...

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

Documentation: github.com/vektah/gqlparser/v2/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: field 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: directive without args is valid
    94  rule: KnownArgumentNames
    95  schema: 0
    96  query: |2-
    97
    98          {
    99            dog @onField
   100          }
   101
   102  errors: []
   103- name: arg passed to directive without arg is reported
   104  rule: KnownArgumentNames
   105  schema: 0
   106  query: |2-
   107
   108          {
   109            dog @onField(if: true)
   110          }
   111
   112  errors:
   113    - message: Unknown argument "if" on directive "@onField".
   114      locations:
   115        - {line: 3, column: 22}
   116- name: misspelled directive args are reported
   117  rule: KnownArgumentNames
   118  schema: 0
   119  query: |2-
   120
   121          {
   122            dog @skip(iff: true)
   123          }
   124
   125  errors:
   126    - message: Unknown argument "iff" on directive "@skip". Did you mean "if"?
   127      locations:
   128        - {line: 3, column: 19}
   129- name: invalid arg name
   130  rule: KnownArgumentNames
   131  schema: 0
   132  query: |2-
   133
   134          fragment invalidArgName on Dog {
   135            doesKnowCommand(unknown: true)
   136          }
   137
   138  errors:
   139    - message: Unknown argument "unknown" on field "Dog.doesKnowCommand".
   140      locations:
   141        - {line: 3, column: 25}
   142- name: misspelled arg name is reported
   143  rule: KnownArgumentNames
   144  schema: 0
   145  query: |2-
   146
   147          fragment invalidArgName on Dog {
   148            doesKnowCommand(DogCommand: true)
   149          }
   150
   151  errors:
   152    - message: Unknown argument "DogCommand" on field "Dog.doesKnowCommand". Did you mean "dogCommand"?
   153      locations:
   154        - {line: 3, column: 25}
   155- name: unknown args amongst known args
   156  rule: KnownArgumentNames
   157  schema: 0
   158  query: |2-
   159
   160          fragment oneGoodArgOneInvalidArg on Dog {
   161            doesKnowCommand(whoKnows: 1, dogCommand: SIT, unknown: true)
   162          }
   163
   164  errors:
   165    - message: Unknown argument "whoKnows" on field "Dog.doesKnowCommand".
   166      locations:
   167        - {line: 3, column: 25}
   168    - message: Unknown argument "unknown" on field "Dog.doesKnowCommand".
   169      locations:
   170        - {line: 3, column: 55}
   171- name: unknown args deeply
   172  rule: KnownArgumentNames
   173  schema: 0
   174  query: |2-
   175
   176          {
   177            dog {
   178              doesKnowCommand(unknown: true)
   179            }
   180            human {
   181              pet {
   182                ... on Dog {
   183                  doesKnowCommand(unknown: true)
   184                }
   185              }
   186            }
   187          }
   188
   189  errors:
   190    - message: Unknown argument "unknown" on field "Dog.doesKnowCommand".
   191      locations:
   192        - {line: 4, column: 27}
   193    - message: Unknown argument "unknown" on field "Dog.doesKnowCommand".
   194      locations:
   195        - {line: 9, column: 31}

View as plain text