Skip to the content.

< Back


IGraphQLField<TSource>

Namespace: GraphQL.Query.Builder

GraphQL field of TSource interface.

public interface IGraphQLField<TSource> : IGraphQLField

Type Parameters

TSource

Implements IGraphQLField
Attributes NullableContextAttribute

Properties

SelectList

Gets the select list.

List<object?> SelectList { get; }

Property Value

List<Object>

Arguments

Gets the arguments.

Dictionary<string, object?> Arguments { get; }

Property Value

Dictionary<String, Object>

Methods

Alias(String)

Sets the query alias name.

IGraphQLField<TSource> Alias(string alias)

Parameters

alias String
The alias name.

Returns

IGraphQLField<TSource>
The query.

AddField<TProperty>(Expression<Func<TSource, TProperty>>)

Adds a field to the query.

IGraphQLField<TSource> AddField<TProperty>(Expression<Func<TSource, TProperty>> selector)

Type Parameters

TProperty
The property type.

Parameters

selector Expression<Func<TSource, TProperty>>
The field selector.

Returns

IGraphQLField<TSource>
The query.

AddField(String)

Adds a field to the query.

IGraphQLField<TSource> AddField(string field)

Parameters

field String
The field name.

Returns

IGraphQLField<TSource>
The query.

AddField<TSubSource>(Expression<Func<TSource, TSubSource>>, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>)

Adds a sub-object field to the query.

IGraphQLField<TSource> AddField<TSubSource>(Expression<Func<TSource, TSubSource>> selector, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>> build) where TSubSource : class

Type Parameters

TSubSource
The sub-object type.

Parameters

selector Expression<Func<TSource, TSubSource>>
The field selector.

build Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>
The sub-object query building function.

Returns

IGraphQLField<TSource>
The query.

AddField<TSubSource>(Expression<Func<TSource, IEnumerable<TSubSource>>>, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>)

Adds a sub-list field to the query.

IGraphQLField<TSource> AddField<TSubSource>(Expression<Func<TSource, IEnumerable<TSubSource>>> selector, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>> build) where TSubSource : class

Type Parameters

TSubSource
The sub-list object type.

Parameters

selector Expression<Func<TSource, IEnumerable<TSubSource>>>
The field selector.

build Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>
The sub-object query building function.

Returns

IGraphQLField<TSource>
The query.

AddField<TSubSource>(String, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>)

Adds a sub-object field to the query.

IGraphQLField<TSource> AddField<TSubSource>(string field, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>> build) where TSubSource : class

Type Parameters

TSubSource
The sub-object type.

Parameters

field String
The field name.

build Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>
The sub-object query building function.

Returns

IGraphQLField<TSource>
The query.

AddField<TProperty>(Expression<Func<TSource, TProperty>>, params GraphQLDirective[])

Adds a field to the query with directives.

IGraphQLField<TSource> AddField<TProperty>(Expression<Func<TSource, TProperty>> selector, params GraphQLDirective[] directives)

Type Parameters

TProperty
The property type.

Parameters

selector Expression<Func<TSource, TProperty>>
The field selector.

params directives GraphQLDirective[]
The directives to attach to the field.

Returns

IGraphQLField<TSource>
The query.

AddField(String, params GraphQLDirective[])

Adds a field to the query with directives.

IGraphQLField<TSource> AddField(string field, params GraphQLDirective[] directives)

Parameters

field String
The field name.

params directives GraphQLDirective[]
The directives to attach to the field.

Returns

IGraphQLField<TSource>
The query.

AddField<TSubSource>(Expression<Func<TSource, TSubSource>>, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>, params GraphQLDirective[])

Adds a sub-object field to the query with directives.

IGraphQLField<TSource> AddField<TSubSource>(Expression<Func<TSource, TSubSource>> selector, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>> build, params GraphQLDirective[] directives) where TSubSource : class

Type Parameters

TSubSource
The sub-object type.

Parameters

selector Expression<Func<TSource, TSubSource>>
The field selector.

build Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>
The sub-object query building function.

params directives GraphQLDirective[]
The directives to attach to the field.

Returns

IGraphQLField<TSource>
The query.

AddField<TSubSource>(Expression<Func<TSource, IEnumerable<TSubSource>>>, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>, params GraphQLDirective[])

Adds a sub-list field to the query with directives.

IGraphQLField<TSource> AddField<TSubSource>(Expression<Func<TSource, IEnumerable<TSubSource>>> selector, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>> build, params GraphQLDirective[] directives) where TSubSource : class

Type Parameters

TSubSource
The sub-list object type.

Parameters

selector Expression<Func<TSource, IEnumerable<TSubSource>>>
The field selector.

build Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>
The sub-object query building function.

params directives GraphQLDirective[]
The directives to attach to the field.

Returns

IGraphQLField<TSource>
The query.

AddField<TSubSource>(String, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>, params GraphQLDirective[])

Adds a sub-object field to the query with directives.

IGraphQLField<TSource> AddField<TSubSource>(string field, Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>> build, params GraphQLDirective[] directives) where TSubSource : class

Type Parameters

TSubSource
The sub-object type.

Parameters

field String
The field name.

build Func<IGraphQLField<TSubSource>, IGraphQLField<TSubSource>>
The sub-object query building function.

params directives GraphQLDirective[]
The directives to attach to the field.

Returns

IGraphQLField<TSource>
The query.

AddFragment(GraphQLFragment)

Adds a fragment spread to the query.

IGraphQLField<TSource> AddFragment(GraphQLFragment fragment)

Parameters

fragment GraphQLFragment
The fragment.

Returns

IGraphQLField<TSource>
The query.

AddUnion<TUnionType>(String, Func<IGraphQLField<TUnionType>, IGraphQLField<TUnionType>>)

Adds an union to the query.

IGraphQLField<TSource> AddUnion<TUnionType>(string typeName, Func<IGraphQLField<TUnionType>, IGraphQLField<TUnionType>> build) where TUnionType : class, TSource

Type Parameters

TUnionType
The union type.

Parameters

typeName String
The union type name.

build Func<IGraphQLField<TUnionType>, IGraphQLField<TUnionType>>
The union building function.

Returns

IGraphQLField<TSource>
The query.

AddUnion<TUnionType>(Func<IGraphQLField<TUnionType>, IGraphQLField<TUnionType>>)

Adds an union to the query.

IGraphQLField<TSource> AddUnion<TUnionType>(Func<IGraphQLField<TUnionType>, IGraphQLField<TUnionType>> build) where TUnionType : class, TSource

Type Parameters

TUnionType
The union type.

Parameters

build Func<IGraphQLField<TUnionType>, IGraphQLField<TUnionType>>
The union building function.

Returns

IGraphQLField<TSource>
The query.

AddArgument(String, Object)

Adds a new argument to the query.

IGraphQLField<TSource> AddArgument(string key, object? value)

Parameters

key String
The argument name.

value Object?
The value.

Returns

IGraphQLField<TSource>
The query.

AddArguments(Dictionary<String, Object>)

Adds arguments to the query.

IGraphQLField<TSource> AddArguments(Dictionary<string, object?> arguments)

Parameters

arguments Dictionary<String, Object>
the dictionary argument.

Returns

IGraphQLField<TSource>
The query.

AddArguments<TArguments>(TArguments)

Adds arguments to the query.

IGraphQLField<TSource> AddArguments<TArguments>(TArguments arguments) where TArguments : class

Type Parameters

TArguments
The arguments object type.

Parameters

arguments TArguments
The arguments object.

Returns

IGraphQLField<TSource>
The query.


< Back