...

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

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

     1- name: no deprecated fields/ignores fields that are not deprecated
     2  rule: NoDeprecatedCustom
     3  schema: 4
     4  query: |2-
     5
     6            {
     7              normalField
     8            }
     9
    10  errors: []
    11- name: no deprecated fields/ignores unknown fields
    12  rule: NoDeprecatedCustom
    13  schema: 4
    14  query: |2-
    15
    16            {
    17              unknownField
    18            }
    19            
    20            fragment UnknownFragment on UnknownType {
    21              deprecatedField
    22            }
    23
    24  errors: []
    25- name: no deprecated fields/reports error when a deprecated field is selected
    26  rule: NoDeprecatedCustom
    27  schema: 4
    28  query: |2-
    29
    30            {
    31              deprecatedField
    32            }
    33            
    34            fragment QueryFragment on Query {
    35              deprecatedField
    36            }
    37
    38  errors:
    39    - message: The field Query.deprecatedField is deprecated. Some field reason.
    40      locations:
    41        - {line: 3, column: 11}
    42    - message: The field Query.deprecatedField is deprecated. Some field reason.
    43      locations:
    44        - {line: 7, column: 11}
    45- name: no deprecated arguments on fields/ignores arguments that are not deprecated
    46  rule: NoDeprecatedCustom
    47  schema: 5
    48  query: |2-
    49
    50            {
    51              normalField(normalArg: "")
    52            }
    53
    54  errors: []
    55- name: no deprecated arguments on fields/ignores unknown arguments
    56  rule: NoDeprecatedCustom
    57  schema: 5
    58  query: |2-
    59
    60            {
    61              someField(unknownArg: "")
    62              unknownField(deprecatedArg: "")
    63            }
    64
    65  errors: []
    66- name: no deprecated arguments on fields/reports error when a deprecated argument is used
    67  rule: NoDeprecatedCustom
    68  schema: 5
    69  query: |2-
    70
    71            {
    72              someField(deprecatedArg: "")
    73            }
    74
    75  errors:
    76    - message: Field "Query.someField" argument "deprecatedArg" is deprecated. Some arg reason.
    77      locations:
    78        - {line: 3, column: 21}
    79- name: no deprecated arguments on directives/ignores arguments that are not deprecated
    80  rule: NoDeprecatedCustom
    81  schema: 6
    82  query: |2-
    83
    84            {
    85              someField @someDirective(normalArg: "")
    86            }
    87
    88  errors: []
    89- name: no deprecated arguments on directives/ignores unknown arguments
    90  rule: NoDeprecatedCustom
    91  schema: 6
    92  query: |2-
    93
    94            {
    95              someField @someDirective(unknownArg: "")
    96              someField @unknownDirective(deprecatedArg: "")
    97            }
    98
    99  errors: []
   100- name: no deprecated arguments on directives/reports error when a deprecated argument is used
   101  rule: NoDeprecatedCustom
   102  schema: 6
   103  query: |2-
   104
   105            {
   106              someField @someDirective(deprecatedArg: "")
   107            }
   108
   109  errors:
   110    - message: Directive "@someDirective" argument "deprecatedArg" is deprecated. Some arg reason.
   111      locations:
   112        - {line: 3, column: 36}
   113- name: no deprecated input fields/ignores input fields that are not deprecated
   114  rule: NoDeprecatedCustom
   115  schema: 7
   116  query: |2-
   117
   118            {
   119              someField(
   120                someArg: { normalField: "" }
   121              ) @someDirective(someArg: { normalField: "" })
   122            }
   123
   124  errors: []
   125- name: no deprecated input fields/ignores unknown input fields
   126  rule: NoDeprecatedCustom
   127  schema: 7
   128  query: |2-
   129
   130            {
   131              someField(
   132                someArg: { unknownField: "" }
   133              )
   134            
   135              someField(
   136                unknownArg: { unknownField: "" }
   137              )
   138            
   139              unknownField(
   140                unknownArg: { unknownField: "" }
   141              )
   142            }
   143
   144  errors: []
   145- name: no deprecated input fields/reports error when a deprecated input field is used
   146  rule: NoDeprecatedCustom
   147  schema: 7
   148  query: |2-
   149
   150            {
   151              someField(
   152                someArg: { deprecatedField: "" }
   153              ) @someDirective(someArg: { deprecatedField: "" })
   154            }
   155
   156  errors:
   157    - message: The input field InputType.deprecatedField is deprecated. Some input field reason.
   158      locations:
   159        - {line: 4, column: 24}
   160    - message: The input field InputType.deprecatedField is deprecated. Some input field reason.
   161      locations:
   162        - {line: 5, column: 39}
   163- name: no deprecated enum values/ignores enum values that are not deprecated
   164  rule: NoDeprecatedCustom
   165  schema: 8
   166  query: |2-
   167
   168            {
   169              normalField(enumArg: NORMAL_VALUE)
   170            }
   171
   172  errors: []
   173- name: no deprecated enum values/ignores unknown enum values
   174  rule: NoDeprecatedCustom
   175  schema: 8
   176  query: |2-
   177
   178            query (
   179              $unknownValue: EnumType = UNKNOWN_VALUE
   180              $unknownType: UnknownType = UNKNOWN_VALUE
   181            ) {
   182              someField(enumArg: UNKNOWN_VALUE)
   183              someField(unknownArg: UNKNOWN_VALUE)
   184              unknownField(unknownArg: UNKNOWN_VALUE)
   185            }
   186            
   187            fragment SomeFragment on Query {
   188              someField(enumArg: UNKNOWN_VALUE)
   189            }
   190
   191  errors: []
   192- name: no deprecated enum values/reports error when a deprecated enum value is used
   193  rule: NoDeprecatedCustom
   194  schema: 8
   195  query: |2-
   196
   197            query (
   198              $variable: EnumType = DEPRECATED_VALUE
   199            ) {
   200              someField(enumArg: DEPRECATED_VALUE)
   201            }
   202
   203  errors:
   204    - message: The enum value "EnumType.DEPRECATED_VALUE" is deprecated. Some enum reason.
   205      locations:
   206        - {line: 3, column: 33}
   207    - message: The enum value "EnumType.DEPRECATED_VALUE" is deprecated. Some enum reason.
   208      locations:
   209        - {line: 5, column: 30}

View as plain text