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(); }
public override bool CanHandle( ITypeDiscoveryContext context, FilterInputTypeDefinition typeDefinition, FilterFieldDefinition fieldDefinition) { return(true); }
public Response DeleteFilterField([FromBody] FilterFieldDefinition filterField) { return(GetResponse(() => { new EditorService(User).DeleteFilterField(filterField); })); }
public Response <FilterFieldDefinition> CreateFilterField([FromBody] FilterFieldDefinition filterField) { return(GetResponse(() => { return new EditorService(User).CreateFilterField(filterField); })); }
public override bool CanHandle( ITypeDiscoveryContext context, FilterInputTypeDefinition typeDefinition, FilterFieldDefinition fieldDefinition) { return(fieldDefinition is FilterOperationFieldDefinition def && def.Id == DefaultOperations.Data); }
public override bool CanHandle( ITypeDiscoveryContext context, FilterInputTypeDefinition typeDefinition, FilterFieldDefinition fieldDefinition) { return(fieldDefinition is FilterOperationFieldDefinition { Id : 155 });
public override bool CanHandle( ITypeDiscoveryContext context, FilterInputTypeDefinition typeDefinition, FilterFieldDefinition fieldDefinition) { return(context.Type is IEnumOperationInput && fieldDefinition is FilterOperationFieldDefinition operationField && operationField.Id == Operation); }
public override bool CanHandle( ITypeDiscoveryContext context, FilterInputTypeDefinition typeDefinition, FilterFieldDefinition fieldDefinition) { return(context.Type is IListFilterInputType && fieldDefinition is FilterOperationFieldDefinition operationField && operationField.Id == DefaultOperations.Any); }
public static SchemaException FilterInterceptor_NoHandlerFoundForField( FilterInputTypeDefinition type, FilterFieldDefinition field) => new SchemaException( SchemaErrorBuilder.New() .SetMessage( "For the field {0} of type {1} was no handler found.", field.Name, type.Name) .Build());
public static SchemaException FilterInterceptor_NoHandlerFoundForField( FilterInputTypeDefinition type, FilterFieldDefinition field) => new SchemaException( SchemaErrorBuilder.New() .SetMessage( DataResources.FilterInterceptor_NoHandlerFoundForField, field.Name, type.Name) .Build());
internal FilterField(FilterFieldDefinition definition) : base(definition, default) { Member = definition.Member; Handler = definition.Handler !; }
public override bool CanHandle( ITypeDiscoveryContext context, FilterInputTypeDefinition typeDefinition, FilterFieldDefinition fieldDefinition) => !(fieldDefinition is FilterOperationFieldDefinition) && fieldDefinition.Member is not null;