private static void DeclareFields( ITypeBindingInfo bindingInfo, IReadOnlySchemaOptions schemaOptions, IObjectTypeDescriptor typeDescriptor, IReadOnlyCollection <FieldDefinitionNode> fieldDefinitions) { foreach (FieldDefinitionNode fieldDefinition in fieldDefinitions) { bindingInfo.TrackField(fieldDefinition.Name.Value); IObjectFieldDescriptor fieldDescriptor = typeDescriptor .Field(fieldDefinition.Name.Value) .Description(fieldDefinition.Description?.Value) .Type(fieldDefinition.Type) .SyntaxNode(schemaOptions.PreserveSyntaxNodes ? fieldDefinition : null); if (bindingInfo.TryGetFieldMember( fieldDefinition.Name.Value, MemberKind.ObjectField, out MemberInfo member)) { fieldDescriptor.Extend().OnBeforeCreate( t => t.Member = member); } foreach (DirectiveNode directive in fieldDefinition.Directives) { if (!directive.IsDeprecationReason()) { fieldDescriptor.Directive(directive); } } string deprecactionReason = fieldDefinition.DeprecationReason(); if (!string.IsNullOrEmpty(deprecactionReason)) { fieldDescriptor.Deprecated(deprecactionReason); } DeclareFieldArguments(schemaOptions, fieldDescriptor, fieldDefinition); } }