Skip to content

GraphiQL connection issues #4474

Discussion options

You must be logged in to vote

Works fine with this repo, just not my own, created via following the docs!

https://github.com/ChilliCream/graphql-workshop/tree/master/code/complete

Edit:

I solved this, It was a CORS issue.

For anyone following the 'get started' guide who is unable to get graphiQL working, you'll need the following configuration.

For .net 6, in Program.cs

builder.Services.AddCors(o =>
                    o.AddDefaultPolicy(b =>
                        b.AllowAnyHeader()
                            .AllowAnyMethod()
                            .AllowAnyOrigin()))

    .AddGraphQLServer()
    .AddQueryType<Query>()
    .AddProjections()
    .AddFiltering()
    .AddSorting();

and then after var app = buil…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aaron-manning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant