public IPublishSchemaDefinitionDescriptor SetName(NameString name) { _name = name; return(this); }
public ICompletedDependencyDescriptor DependsOn( NameString typeName) => DependsOn(typeName, false);
protected IntTypeBase(NameString name) : this(name, int.MinValue, int.MaxValue) { }
public static IRequestExecutorBuilder AddGraphQLServer( this IRequestExecutorBuilder builder, NameString schemaName = default) => builder.Services.AddGraphQLServer(schemaName);
public static InvalidOperationException RequestExecutorResolver_SchemaNameDoesNotMatch( NameString configurationSchemaName, NameString schemaName) => new InvalidOperationException( "The schema name must allign with the schema name expected by the configuration.");
protected DateTimeTypeBase(NameString name) : base(name) { }
public IObjectFieldDescriptor Field(NameString name) { ObjectFieldDescriptor fieldDescriptor = Fields.FirstOrDefault(t => t.Definition.Name.Equals(name)); if (fieldDescriptor is { })
public new IObjectFieldDescriptor Name(NameString value) { base.Name(value); return(this); }
/// <inheritdoc /> public new IFilterInputTypeDescriptor <T> Ignore(NameString name) { base.Ignore(name); return(this); }
/// <inheritdoc/> public new IArrayFilterFieldDescriptor <TArray> Name(NameString value) { base.Name(value); return(this); }
public static ObjectFieldDescriptor New( IDescriptorContext context, NameString fieldName) => new ObjectFieldDescriptor(context, fieldName);
public bool ContainsType(NameString typeName) => _typeMap.ContainsKey(typeName.EnsureNotEmpty(nameof(typeName)));
public override FieldMiddleware CreateExecutor <TEntityType>(NameString argumentName) { return(next => context => ExecuteAsync(next, context)); async ValueTask ExecuteAsync( FieldDelegate next, IMiddlewareContext context) { // first we let the pipeline run and produce a result. await next(context).ConfigureAwait(false); // next we get the filter argument. If the filter argument is already on the context // we use this. This enabled overriding the context with LocalContextData IInputField argument = context.Field.Arguments[argumentName]; IValueNode filter = context.LocalContextData.ContainsKey(ContextValueNodeKey) && context.LocalContextData[ContextValueNodeKey] is IValueNode node ? node : context.ArgumentLiteral <IValueNode>(argumentName); // if no filter is defined we can stop here and yield back control. if (filter.IsNull() || (context.LocalContextData.TryGetValue( SkipFilteringKey, out object?skipObject) && skipObject is bool skip && skip)) { return; } IQueryable <TEntityType>?source = null; if (context.Result is IQueryable <TEntityType> q) { source = q; } else if (context.Result is IEnumerable <TEntityType> e) { source = e.AsQueryable(); } if (source != null && argument.Type is IFilterInputType filterInput && context.Field.ContextData.TryGetValue( ContextVisitFilterArgumentKey, out object?executorObj) && executorObj is VisitFilterArgument executor) { QueryableFilterContext visitorContext = executor( filter, filterInput, source is EnumerableQuery); // compile expression tree if (visitorContext.TryCreateLambda( out Expression <Func <TEntityType, bool> >?where)) { context.Result = source.Where(where); } else { if (visitorContext.Errors.Count > 0) { context.Result = Array.Empty <TEntityType>(); foreach (IError error in visitorContext.Errors) { context.ReportError(error.WithPath(context.Path)); } } } } } }
/// <inheritdoc/> public new IBooleanFilterOperationDescriptor Name(NameString value) { base.Name(value); return(this); }
public void ConfigureField(NameString argumentName, IObjectFieldDescriptor descriptor) { throw new NotImplementedException(); }
/// <inheritdoc /> public new IFilterInputTypeDescriptor <T> Name(NameString value) { base.Name(value); return(this); }
public NameDirectiveReference(NameString name) { Name = name.EnsureNotEmpty(nameof(name)); }
/// <inheritdoc /> public ISortConventionDescriptor ArgumentName(NameString argumentName) { Definition.ArgumentName = argumentName; return(this); }
public IObjectTypeDescriptor Name(NameString value) { Definition.Name = value.EnsureNotEmpty(nameof(value)); return(this); }
public static bool IsBuiltIn(NameString typeName) { return(typeName.HasValue && _directiveNames.Contains(typeName.Value)); }
/// <inheritdoc /> public virtual NameString GetTypeName(Type runtimeType) { if (runtimeType is null) { throw new ArgumentNullException(nameof(runtimeType)); } if (typeof(IEnumOperationFilterInputType).IsAssignableFrom(runtimeType) && runtimeType.GenericTypeArguments.Length == 1 && runtimeType.GetGenericTypeDefinition() == typeof(EnumOperationFilterInputType <>)) { NameString genericName = _namingConventions.GetTypeName(runtimeType.GenericTypeArguments[0]); return(genericName.Value + "OperationFilterInput"); } if (typeof(IComparableOperationFilterInputType).IsAssignableFrom(runtimeType) && runtimeType.GenericTypeArguments.Length == 1 && runtimeType.GetGenericTypeDefinition() == typeof(ComparableOperationFilterInputType <>)) { NameString genericName = _namingConventions.GetTypeName(runtimeType.GenericTypeArguments[0]); return($"Comparable{genericName.Value}OperationFilterInput"); } if (typeof(IListFilterInputType).IsAssignableFrom(runtimeType) && runtimeType.GenericTypeArguments.Length == 1 && runtimeType.GetGenericTypeDefinition() == typeof(ListFilterInputType <>)) { Type genericType = runtimeType.GenericTypeArguments[0]; NameString genericName; if (typeof(FilterInputType).IsAssignableFrom(genericType)) { genericName = GetTypeName(genericType); } else { genericName = _namingConventions.GetTypeName(genericType); } return("List" + genericName.Value); } string name = _namingConventions.GetTypeName(runtimeType); var isInputObjectType = typeof(FilterInputType).IsAssignableFrom(runtimeType); var isEndingInput = name.EndsWith(_inputPostFix, StringComparison.Ordinal); var isEndingInputType = name.EndsWith(_inputTypePostFix, StringComparison.Ordinal); if (isInputObjectType && isEndingInputType) { return(name.Substring(0, name.Length - 4)); } if (isInputObjectType && !isEndingInput && !isEndingInputType) { return(name + _inputPostFix); } if (!isInputObjectType && !isEndingInput) { return(name + _inputPostFix); } return(name); }
public FloatType(NameString name) : this(name, double.MinValue, double.MaxValue) { }
/// <inheritdoc/> public new IObjectFilterOperationDescriptor <TObject> Name(NameString value) { base.Name(value); return(this); }
public FloatType(NameString name, double min, double max) : base(name, min, max) { }
public new IDirectiveTypeDescriptor <T> Name(NameString value) { base.Name(value); return(this); }
public FloatType(NameString name, string description, double min, double max) : base(name, min, max) { Description = description; }
public IFilterInputTypeDescriptor <T> Name(NameString value) { Definition.Name = value.EnsureNotEmpty(nameof(value)); return(this); }
public FieldMiddleware CreateExecutor <TEntityType>(NameString argumentName) { throw new NotImplementedException(); }
protected IntTypeBase(NameString name, int min, int max) : base(name) { _min = min; _max = max; }
public bool Contains(NameString key) => _lookup.Contains(key);