@@ -124,7 +124,7 @@ class FieldValidatorVisitor {
124
124
isolated function visistAnyValue(parser : ArgumentNode argumentNode , __InputValue schemaArg ) {
125
125
parser : ArgumentNode modifiedArgNode = self .nodeModifierContext .getModifiedArgumentNode (argumentNode );
126
126
parser : ArgumentValue | parser :ArgumentValue [] value = modifiedArgNode .getValue ();
127
- if value is () && schemaArg .'type .kind == NON_NULL {
127
+ if value == () && schemaArg .'type .kind == NON_NULL {
128
128
string expectedTypeName = getTypeNameFromType (schemaArg .'type );
129
129
string message = string ` ${expectedTypeName } cannot represent non ${expectedTypeName } value: null` ;
130
130
ErrorDetail errorDetail = getErrorDetailRecord (message , modifiedArgNode .getValueLocation ());
@@ -188,7 +188,7 @@ class FieldValidatorVisitor {
188
188
}
189
189
self .modifyArgumentNode (argNode , value = value );
190
190
if ! isProvidedField {
191
- if subInputValue .'type .kind == NON_NULL && subInputValue .defaultValue is () {
191
+ if subInputValue .'type .kind == NON_NULL && subInputValue .defaultValue == () {
192
192
string inputFieldName = getInputObjectFieldFormPath (self .argumentPath , subInputValue .name );
193
193
string message = string ` Field "${inputFieldName }" of required type ` +
194
194
string ` "${getTypeNameFromType (subInputValue .'type )}" was not provided.` ;
@@ -264,7 +264,7 @@ class FieldValidatorVisitor {
264
264
fieldName );
265
265
self .modifyArgumentNode (argumentNode , variableValue = clonedVariableValue );
266
266
self .removePath ();
267
- } else if variableValue is () {
267
+ } else if variableValue == () {
268
268
self .validateArgumentValue (variableValue , modifiedArgNode .getValueLocation (), getTypeName (modifiedArgNode ),
269
269
schemaArg );
270
270
} else {
@@ -273,7 +273,7 @@ class FieldValidatorVisitor {
273
273
expectedTypeName = getTypeNameFromType (schemaArg .'type );
274
274
}
275
275
string listError = getListElementError (self .argumentPath );
276
- string value = variableValue is () ? " null" : variableValue .toString ();
276
+ string value = variableValue == () ? " null" : variableValue .toString ();
277
277
string message = string ` ${listError }${expectedTypeName } cannot represent non ${expectedTypeName } value:` +
278
278
string ` ${value }` ;
279
279
ErrorDetail errorDetail = getErrorDetailRecord (message , modifiedArgNode .getValueLocation ());
@@ -283,7 +283,7 @@ class FieldValidatorVisitor {
283
283
284
284
isolated function validateArgumentValue(parser : ArgumentValue value , Location valueLocation , string actualTypeName ,
285
285
__InputValue schemaArg ) {
286
- if value is () {
286
+ if value == () {
287
287
if schemaArg .'type .kind == NON_NULL {
288
288
string listError = getListElementError (self .argumentPath );
289
289
string message = string ` ${listError }Expected value of type "${getTypeNameFromType (schemaArg .'type )}"` +
@@ -360,12 +360,12 @@ class FieldValidatorVisitor {
360
360
self .validateListVariableValue (fieldValueClone , subInputValue , location , fieldName );
361
361
variableValues[subInputValue .name ] = fieldValueClone ;
362
362
self .removePath ();
363
- } else if fieldValue is () {
363
+ } else if fieldValue == () {
364
364
string expectedTypeName = getOfTypeName (inputValue .'type );
365
365
self .validateArgumentValue (fieldValue , location , expectedTypeName , subInputValue );
366
366
}
367
367
} else {
368
- if subInputValue .'type .kind == NON_NULL && inputValue ?.defaultValue is () {
368
+ if subInputValue .'type .kind == NON_NULL && inputValue ?.defaultValue == () {
369
369
string inputField = getInputObjectFieldFormPath (self .argumentPath , subInputValue .name );
370
370
string message = string ` Field "${inputField }" of required type ` +
371
371
string ` "${getTypeNameFromType (subInputValue .'type )}" was not provided.` ;
@@ -400,7 +400,7 @@ class FieldValidatorVisitor {
400
400
foreach int i in 0 ..< variableValues .length () {
401
401
self .updatePath (i );
402
402
json listItemValue = variableValues [i ];
403
- if listItemValue is () {
403
+ if listItemValue == () {
404
404
string expectedTypeName = getOfTypeName (listItemInputValue .'type );
405
405
self .validateArgumentValue (listItemValue , location , expectedTypeName , listItemInputValue );
406
406
} else if getOfTypeName (listItemInputValue .'type ) == subgraph : ANY {
@@ -545,7 +545,7 @@ class FieldValidatorVisitor {
545
545
}
546
546
547
547
foreach __InputValue inputValue in notFoundInputValues {
548
- if inputValue .'type .kind == NON_NULL && inputValue ?.defaultValue is ()
548
+ if inputValue .'type .kind == NON_NULL && inputValue ?.defaultValue == ()
549
549
&& getOfType (inputValue .'type ).name != UPLOAD {
550
550
string message = getMissingRequiredArgError (fieldNode , inputValue );
551
551
self .errors .push (getErrorDetailRecord (message , fieldNode .getLocation ()));
@@ -560,7 +560,7 @@ class FieldValidatorVisitor {
560
560
}
561
561
string fragmentOnTypeName = fragmentNode .getOnType ();
562
562
__Type ? fragmentOnType = getTypeFromTypeArray (self .schema .types , fragmentOnTypeName );
563
- if fragmentOnType is () {
563
+ if fragmentOnType == () {
564
564
string message = string ` Unknown type "${fragmentOnTypeName }".` ;
565
565
ErrorDetail errorDetail = getErrorDetailRecord (message , fragmentNode .getLocation ());
566
566
self .errors .push (errorDetail );
@@ -592,7 +592,7 @@ class FieldValidatorVisitor {
592
592
foreach parser : ArgumentValue 'field in inputObjectFields {
593
593
if 'field is parser : ArgumentNode {
594
594
int ? index = definedFields .indexOf ('field .getName ());
595
- if index is () {
595
+ if index == () {
596
596
string message = string ` Field "${'field .getName ()}" is not defined by type ` +
597
597
string ` "${node .getName ()}".` ;
598
598
self .errors .push (getErrorDetailRecord (message , 'field .getLocation ()));
@@ -665,7 +665,7 @@ class FieldValidatorVisitor {
665
665
return self .errors .length () > 0 ? self .errors : ();
666
666
}
667
667
668
- private isolated function modifyArgumentNode(parser : ArgumentNode originalNode , parser : ArgumentType ? kind = (),
668
+ private isolated function modifyArgumentNode(parser : ArgumentNode originalNode , int ? kind = (),
669
669
parser : ArgumentValue | parser :ArgumentValue [] value = (),
670
670
json variableValue = ()) {
671
671
parser : ArgumentNode previouslyModifiedNode = self .nodeModifierContext .getModifiedArgumentNode (originalNode );
@@ -699,7 +699,7 @@ isolated function getRequierdFieldFromType(__Type parentType, __Type[] typeArray
699
699
parser : FieldNode fieldNode ) returns __Field ? {
700
700
__Field [] fields = getFieldsArrayFromType (parentType );
701
701
__Field ? requiredField = getFieldFromFieldArray (fields , fieldNode .getName ());
702
- if requiredField is () {
702
+ if requiredField == () {
703
703
if fieldNode .getName () == SCHEMA_FIELD && parentType .name == QUERY_TYPE_NAME {
704
704
__Type fieldType = < __Type > getTypeFromTypeArray (typeArray , SCHEMA_TYPE_NAME );
705
705
requiredField = createField (SCHEMA_FIELD , fieldType );
0 commit comments