GraphQL by Joe McBride

<PackageReference Include="GraphQL" Version="7.0.0" />

 FieldBuilder<TSourceType, TReturnType>

public class FieldBuilder<TSourceType, TReturnType>
Builds a field for a graph with a specified source type and return type.
public FieldType FieldType { get; }

Returns the generated field.

protected FieldBuilder(FieldType fieldType)

Initializes a new instance for the specified FieldType.

public static FieldBuilder<TSourceType, TReturnType> Create(IGraphType type, string name = "default")

Returns a builder for a new field.

public static FieldBuilder<TSourceType, TReturnType> Create(Type type = null, string name = "default")

public virtual FieldBuilder<TSourceType, TReturnType> Argument<TArgumentGraphType>(string name, string description, Action<QueryArgument> configure = null) where TArgumentGraphType : IGraphType

Adds an argument to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Argument<TArgumentGraphType, TArgumentType>(string name, string description, TArgumentType defaultValue = null, Action<QueryArgument> configure = null) where TArgumentGraphType : IGraphType

Adds an argument to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Argument<TArgumentGraphType>(string name) where TArgumentGraphType : IGraphType

Adds an argument to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Argument<TArgumentGraphType>(string name, Action<QueryArgument> configure = null) where TArgumentGraphType : IGraphType

Adds an argument to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Argument<TArgumentClrType>(string name, bool nullable = false, Action<QueryArgument> configure = null)

Adds an argument to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Argument<TArgumentClrType>(string name, bool nullable, string description, Action<QueryArgument> configure = null)

Adds an argument to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Argument(Type type, string name, Action<QueryArgument> configure = null)

Adds an argument to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Arguments(IEnumerable<QueryArgument> arguments)

Adds the specified collection of arguments to the field.

public virtual FieldBuilder<TSourceType, TReturnType> Arguments(QueryArgument[] arguments)

Adds the specified collection of arguments to the field.

public virtual FieldBuilder<TSourceType, TReturnType> ComplexityImpact(double impact)

Specify field's complexity impact which will be taken into account by ComplexityAnalyzer.

public virtual FieldBuilder<TSourceType, TReturnType> Configure(Action<FieldType> configure)

Runs a configuration delegate for the field.

public virtual FieldBuilder<TSourceType, TReturnType> DefaultValue(TReturnType defaultValue = null)

Sets the default value of fields on input object graph types.

public virtual FieldBuilder<TSourceType, TReturnType> DeprecationReason(string deprecationReason)

Sets the deprecation reason of the field.

public virtual FieldBuilder<TSourceType, TReturnType> Description(string description)

Sets the description of the field.

public virtual FieldBuilder<TSourceType, TReturnType> Directive(string name)

Apply directive to field without specifying arguments. If the directive declaration has arguments, then their default values (if any) will be used.

public virtual FieldBuilder<TSourceType, TReturnType> Directive(string name, string argumentName, object argumentValue)

Apply directive to field specifying one argument. If the directive declaration has other arguments, then their default values (if any) will be used.

public virtual FieldBuilder<TSourceType, TReturnType> Directive(string name, string argument1Name, object argument1Value, string argument2Name, object argument2Value)

Apply directive specifying two arguments. If the directive declaration has other arguments, then their default values (if any) will be used.

public virtual FieldBuilder<TSourceType, TReturnType> Directive(string name, Action<AppliedDirective> configure)

Apply directive to field specifying configuration delegate.

public virtual FieldBuilder<TSourceType, TReturnType> Name(string name)

Sets the name of the field.

public virtual FieldBuilder<TSourceType, TReturnType> Resolve(IFieldResolver resolver)

Sets the resolver for the field.

public virtual FieldBuilder<TSourceType, TReturnType> Resolve(Func<IResolveFieldContext<TSourceType>, TReturnType> resolve)

public virtual FieldBuilder<TSourceType, TReturnType> ResolveAsync(Func<IResolveFieldContext<TSourceType>, Task<TReturnType>> resolve)

public virtual FieldBuilder<TSourceType, TReturnType> ResolveDelegate(Delegate resolve)

public virtual FieldBuilder<TSourceType, TReturnType> ResolveStream(Func<IResolveFieldContext<TSourceType>, IObservable<TReturnType>> sourceStreamResolver)

Sets a source stream resolver for the field.

public virtual FieldBuilder<TSourceType, TReturnType> ResolveStreamAsync(Func<IResolveFieldContext<TSourceType>, Task<IObservable<TReturnType>>> sourceStreamResolver)

Sets a source stream resolver for the field.

public virtual FieldBuilder<TSourceType, TNewReturnType> Returns<TNewReturnType>()

Sets the return type of the field.

public virtual FieldBuilder<TSourceType, TReturnType> Type(IGraphType type)

Sets the graph type of the field.