public TypeInitializer(
            IDescriptorContext descriptorContext,
            TypeRegistry typeRegistry,
            IReadOnlyList <ITypeReference> initialTypes,
            IReadOnlyList <Type> externalResolverTypes,
            IsOfTypeFallback?isOfType,
            Func <TypeSystemObjectBase, bool> isQueryType)
        {
            _context = descriptorContext ??
                       throw new ArgumentNullException(nameof(descriptorContext));
            _typeRegistry = typeRegistry ??
                            throw new ArgumentNullException(nameof(typeRegistry));
            _initialTypes = initialTypes ??
                            throw new ArgumentNullException(nameof(initialTypes));
            _externalResolverTypes = externalResolverTypes ??
                                     throw new ArgumentNullException(nameof(externalResolverTypes));
            _isOfType    = isOfType;
            _isQueryType = isQueryType ??
                           throw new ArgumentNullException(nameof(isQueryType));

            _interceptor           = descriptorContext.TypeInterceptor;
            _typeInspector         = descriptorContext.TypeInspector;
            _typeLookup            = new TypeLookup(_typeInspector, _typeRegistry);
            _typeReferenceResolver = new TypeReferenceResolver(
                _typeInspector, _typeRegistry, _typeLookup);
        }
Example #2
0
 public void PrepareForCompletion(
     TypeReferenceResolver typeReferenceResolver,
     Func <ISchema> schemaResolver,
     List <FieldMiddleware> globalComponents,
     IsOfTypeFallback?isOfType)
 {
     _typeReferenceResolver = typeReferenceResolver;
     _schemaResolver        = schemaResolver;
     GlobalComponents       = globalComponents;
     IsOfType = isOfType;
 }
 public TypeCompletionContext(
     TypeDiscoveryContext initializationContext,
     TypeReferenceResolver typeReferenceResolver,
     IList <FieldMiddleware> globalComponents,
     IDictionary <FieldReference, RegisteredResolver> resolvers,
     IsOfTypeFallback isOfType,
     Func <ISchema> schemaResolver)
 {
     _initializationContext = initializationContext ??
                              throw new ArgumentNullException(nameof(initializationContext));
     _typeReferenceResolver = typeReferenceResolver ??
                              throw new ArgumentNullException(nameof(typeReferenceResolver));
     _resolvers = resolvers ??
                  throw new ArgumentNullException(nameof(resolvers));
     IsOfType        = isOfType;
     _schemaResolver = schemaResolver ??
                       throw new ArgumentNullException(nameof(schemaResolver));
     GlobalComponents = new ReadOnlyCollection <FieldMiddleware>(globalComponents);
     _alternateNames.Add(_initializationContext.InternalName);
 }
 internal virtual void InitializeContext(
     IDescriptorContext context,
     TypeReferenceResolver typeReferenceResolver)
 {
 }