private static void CollectDirectiveDependencies( FieldDefinitionBase definition, ICollection <TypeDependency> dependencies) { if (definition.HasDirectives) { foreach (DirectiveDefinition directive in definition.Directives) { dependencies.Add(new(directive.TypeReference, TypeDependencyKind.Completed)); } } }
private static void RewriteDefinition( IDescriptorContext context, FieldDefinitionBase definition) { if (definition.Type is ExtendedTypeReference typeReference) { ITypeInfo typeInfo = context.TypeInspector.CreateTypeInfo(typeReference.Type); IExtendedType type = RewriteType(context.TypeInspector, typeInfo); definition.Type = typeReference.WithType(type); } else { throw new SchemaException(SchemaErrorBuilder.New() .SetMessage("Unable to resolve type from field `{0}`.", definition.Name) .Build()); } }
protected void MergeInto(FieldDefinitionBase <T> target) { base.MergeInto(target); // Note: we are not copying the SyntaxNode on merge. }
protected void CopyTo(FieldDefinitionBase <T> target) { base.CopyTo(target); target.SyntaxNode = SyntaxNode; }