Skip to content

Subscription is not working in MapGraphql Extension while using with RequireAuthorization #3003

Closed

Description

Hi,
Using RequireAuthorization() in MapGraphql() results in Subscription call failure with error "Could not connect to websocket endpoint ". Without RequireAuthorization, its just working fine as expected. Should anything need to be added as service to make it as work?

app.UseEndpoints(endpoints =>
        {
            endpoints.MapControllers();
            endpoints.MapGraphQL();
            endpoints.MapGraphQL("/web", schemaName: "web").RequireAuthorization();

            endpoints.MapGet("/", context =>
            {
                context.Response.Redirect("/playground");
                return Task.CompletedTask;
            });
        });

app.UsePlayground("/web", "/playground");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Area: SubscriptionsIssue is related to Subscriptions or a Subscription Provider❓ questionThis issue is a question about feature of Hot Chocolate.🌶️ hot chocolate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions