public static void RegisterDependencies( this ITypeDiscoveryContext context, ObjectTypeDefinition definition) { if (context is null) { throw new ArgumentNullException(nameof(context)); } if (definition is null) { throw new ArgumentNullException(nameof(definition)); } context.RegisterDependencyRange( definition.GetInterfaces(), TypeDependencyKind.Completed); RegisterAdditionalDependencies(context, definition); RegisterDirectiveDependencies(context, definition); RegisterFieldDependencies(context, definition.Fields); foreach (ObjectFieldDefinition field in definition.Fields) { if (field.Resolver is null) { if (field.Expression is not null) { context.RegisterResolver( field.Name, field.Expression, definition.RuntimeType, field.ResolverType); } else if (field.ResolverMember is not null) { context.RegisterResolver( field.Name, field.ResolverMember, definition.RuntimeType, field.ResolverType); } else if (field.Member is not null) { context.RegisterResolver( field.Name, field.Member, definition.RuntimeType, field.ResolverType); } } } }
protected override void OnCompleteType( ITypeCompletionContext context, ObjectTypeDefinition definition) { base.OnCompleteType(context, definition); if (ValidateFields(context, definition)) { _isOfType = definition.IsOfType; SyntaxNode = definition.SyntaxNode; Fields = OnCompleteFields(context, definition); _implements = CompleteInterfaces(context, definition.GetInterfaces(), this); CompleteTypeResolver(context); } }
public static void RegisterDependencies( this ITypeDiscoveryContext context, ObjectTypeDefinition definition) { if (context is null) { throw new ArgumentNullException(nameof(context)); } if (definition is null) { throw new ArgumentNullException(nameof(definition)); } context.RegisterDependencyRange( definition.GetInterfaces(), TypeDependencyKind.Completed); RegisterAdditionalDependencies(context, definition); RegisterDirectiveDependencies(context, definition); RegisterFieldDependencies(context, definition.Fields); }