'How to call UseEndpoints() and MapGraphQL() for HotChocolate on Azure Function isolated/out-of-process?

I follow this repo https://github.com/chandsalam1108/GraphQLAzFunctionNet5 and https://chillicream.com/docs/hotchocolate/server/endpoints#mapgraphql

How do I call MapGraphQL()? I only have access to IHost:


    public class Program
    {
        public static void Main()
        {
            var host = new HostBuilder()
                .ConfigureFunctionsWorkerDefaults()
                .ConfigureServices(s =>
                {
                    s.AddTransient<IUserRepository, UserRepository>();
                    s.AddSingleton<GraphQLAzureFunctionsExecutorProxyV12>();
                    s.AddGraphQLServer()
                    .AddQueryType<Query>()
                    .AddFiltering()
                    .AddSorting();

                }).Build();

            host.Run();
        }
    }


Solution 1:[1]

Ihost is used to build headless services and is used on a console application.

While using MapGraphQL() on an endpoint will help get and post requests.

Ihost is used to create host on which the app will run.

refer this article by STEVE GORDON

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MohitGanorkar-MT