private IGraphTypeDescriptor GetGraphTypeDescriptor()

in src/Epam.GraphQL/Configuration/RelationRegistry.cs [696:717]


        private IGraphTypeDescriptor<TReturnType, TExecutionContext> GetGraphTypeDescriptor<TReturnType>(
            IField<TExecutionContext> parent,
            IChainConfigurationContext configurationContext,
            bool isInput)
        {
            if (parent == null || typeof(TReturnType).IsValueType || typeof(TReturnType) == typeof(string))
            {
                return new GraphTypeDescriptor<TReturnType, TExecutionContext>(this, isInput);
            }

            if (typeof(TReturnType) != typeof(string) && typeof(TReturnType).IsEnumerableType())
            {
                var elementType = typeof(TReturnType).GetEnumerableElementType();
                var elementDescriptor = GetGraphTypeDescriptor(elementType, parent, configurationContext, isInput);

                return (IGraphTypeDescriptor<TReturnType, TExecutionContext>)typeof(ListGraphTypeDescriptor<,,>)
                    .MakeGenericType(elementType, typeof(TReturnType), typeof(TExecutionContext))
                    .CreateInstanceAndHoistBaseException(elementDescriptor);
            }

            return new ObjectGraphTypeDescriptor<TReturnType, TExecutionContext>(parent, this, null, configurationContext, isInput);
        }