GraphQL.Net v5 and .Net 6 Installation

145 views Asked by At

Has anyone successfully implemented GraphQL.NET v5 in .NET 6 and been able to register in Program.cs as there is no Startup.cs? There are breaking changes from V4.

This is the message I get after upgrade to v5 regards, Olafur

1

There are 1 answers

0
Raj On

Yes I have but I am using latest version 7.3.0 with .NET 6 Installation, the signature for AddGraphQL has changed as below, the sample code in Program.cs in .net 6.

AddGraphQL(Action<IGraphQLBuilder>? configure)

builder.Services.AddGraphQL(builder => builder
.AddSystemTextJson()
.AddSchema<SampleSchema>()
.AddGraphTypes(typeof(SampleQuery).Assembly)
.AddErrorInfoProvider(opt => opt.ExposeExceptionDetails = true)
.AddDataLoader());