protected InterfaceFieldDescriptor Field(NameString name) { var fieldDescriptor = new InterfaceFieldDescriptor( name.EnsureNotEmpty(nameof(name))); Fields.Add(fieldDescriptor); return(fieldDescriptor); }
private static InterfaceFieldDescription ExecuteConfigure( Action <IInterfaceFieldDescriptor> configure) { if (configure == null) { throw new ArgumentNullException(nameof(configure)); } var descriptor = new InterfaceFieldDescriptor(); configure(descriptor); return(descriptor.CreateDescription()); }
protected InterfaceFieldDescriptor Field(string name) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException( "The field name cannot be null or empty.", nameof(name)); } if (!ValidationHelper.IsFieldNameValid(name)) { throw new ArgumentException( "The specified name is not a valid GraphQL field name.", nameof(name)); } var fieldDescriptor = new InterfaceFieldDescriptor(name); Fields.Add(fieldDescriptor); return(fieldDescriptor); }
public void Type_Syntax_Type_Null() { void Error() => InterfaceFieldDescriptor.New(Context, "foo").Type((string)null); Assert.Throws <ArgumentNullException>(Error); }