private static ITypeReference RewriteTypeToNullableType( FilterFieldDefinition definition, ITypeInspector typeInspector) { ITypeReference reference = definition.Type; if (reference is ExtendedTypeReference extendedTypeRef) { return(extendedTypeRef.Type.IsNullable ? extendedTypeRef : extendedTypeRef.WithType(typeInspector.ChangeNullability(extendedTypeRef.Type, true))); } if (reference is SchemaTypeReference schemaRef) { return(schemaRef.Type is NonNullType nnt ? schemaRef.WithType(nnt.Type) : schemaRef); } if (reference is SyntaxTypeReference syntaxRef) { return(syntaxRef.Type is NonNullTypeNode nnt ? syntaxRef.WithType(nnt.Type) : syntaxRef); } throw new NotSupportedException(); }
private static ITypeReference RewriteToNonNullableType( ITypeInspector typeInspector, ITypeReference reference) { if (reference is ExtendedTypeReference extendedTypeRef) { return(extendedTypeRef.Type.IsNullable ? extendedTypeRef.WithType( typeInspector.ChangeNullability(extendedTypeRef.Type, false)) : extendedTypeRef); } throw new NotSupportedException(); }