Skip to the content.

< Back


QueryStringBuilder

Namespace: GraphQL.Query.Builder

The GraphQL query builder class.

public class QueryStringBuilder : IQueryStringBuilder

Inheritance ObjectQueryStringBuilder
Implements IQueryStringBuilder
Attributes NullableContextAttribute, NullableAttribute

Fields

formatter

The property name formatter.

protected Func<PropertyInfo, string> formatter;

Properties

QueryString

The query string builder.

public StringBuilder QueryString { get; }

Property Value

StringBuilder

Constructors

QueryStringBuilder()

Initializes a new instance of the QueryStringBuilder class.

public QueryStringBuilder()

QueryStringBuilder(Func<PropertyInfo, String>)

Initializes a new instance of the QueryStringBuilder class.

public QueryStringBuilder(Func<PropertyInfo, string> formatter)

Parameters

formatter Func<PropertyInfo, String>
The property name formatter

Methods

Build<TSource>(IQuery<TSource>)

Builds the query.

public string Build<TSource>(IQuery<TSource> query)

Type Parameters

TSource

Parameters

query IQuery<TSource>
The query.

Returns

String
The GraphQL query as string, without outer enclosing block.

Clear()

Clears the string builder.

public void Clear()

FormatQueryParam(Object)

Formats query param.

Returns:

protected internal string FormatQueryParam(object value)

Parameters

value Object

Returns

String
The formatted query param.

Exceptions

InvalidDataException
Invalid Object Type in Param List

AddParams<TSource>(IQuery<TSource>)

Adds query params to the query string.

protected internal void AddParams<TSource>(IQuery<TSource> query)

Type Parameters

TSource

Parameters

query IQuery<TSource>
The query.

AddFields<TSource>(IQuery<TSource>)

Adds fields to the query sting.

protected internal void AddFields<TSource>(IQuery<TSource> query)

Type Parameters

TSource

Parameters

query IQuery<TSource>
The query.

Exceptions

ArgumentException
Invalid Object in Field List


< Back