public static TBuilder WithOptionalVariable <TBuilder, TValue>(this IGraphQLBuilder builder, string name, TValue value, Func <TValue, bool> nullCheck = null) where TBuilder : IGraphQLBuilder { if (nullCheck == null) { nullCheck = v => value == null; } if (nullCheck(value)) { return((TBuilder)builder); } return(builder.WithVariable <TBuilder>(name, value)); }