Пример #1
0
        public IEnumerable <SchemaError> CompleteTypes()
        {
            // compile resolvers
            _resolverRegistry.BuildResolvers();

            // start type completion
            var errors    = new List <SchemaError>();
            var processed = new HashSet <INamedType>();

            // directives
            CompleteDirectives(errors);

            // InputObjects
            CompleteTypes(
                _typeRegistry.GetTypes().OfType <InputObjectType>(),
                processed, errors);

            // interfaces
            CompleteTypes(
                _typeRegistry.GetTypes().OfType <InterfaceType>(),
                processed, errors);

            // all the other types
            CompleteTypes(
                _typeRegistry.GetTypes(),
                processed, errors);

            return(errors);
        }
Пример #2
0
        public IEnumerable <SchemaError> CompleteTypes()
        {
            // compile resolvers
            _resolverRegistry.BuildResolvers();

            // complete types
            List <SchemaError> errors = new List <SchemaError>();

            foreach (INeedsInitialization initializer in _typeRegistry.GetTypes()
                     .OfType <INeedsInitialization>())
            {
                initializer.CompleteType(this, e => errors.Add(e));
            }
            return(errors);
        }
Пример #3
0
        public IEnumerable <SchemaError> CompleteTypes()
        {
            // compile resolvers
            _resolverRegistry.BuildResolvers();

            // complete types
            List <SchemaError> errors = new List <SchemaError>();

            foreach (INamedType namedType in _typeRegistry.GetTypes())
            {
                if (namedType is INeedsInitialization init)
                {
                    var initializationContext = new TypeInitializationContext(
                        this, e => errors.Add(e), namedType, false);
                    init.CompleteType(initializationContext);
                }
            }
            return(errors);
        }