graphql-dotnet: GraphQL --version 3.0.0 System.MissingMethodException: Method not found: 'Void GraphQL.ExecutionOptions.set_ExposeExceptions(Boolean)'.
Description
I use the GraphQL Version=“3.0.0” and GraphQL.Server Version=“3.5.0-alpha0073”
<PackageReference Include="GraphQL" Version="3.0.0" />
<PackageReference Include="GraphQL.SystemTextJson" Version="3.0.0" />
<!-- <PackageReference Include="GraphQL.Authorization" Version="3.0.43" /> -->
<PackageReference Include="GraphQL.Server.Transports.AspNetCore" Version="3.5.0-alpha0073" />
<PackageReference Include="GraphQL.Server.Transports.AspNetCore.SystemTextJson" Version="3.5.0-alpha0073" />
startup.cs
public void ConfigureServices(IServiceCollection services)
{
...
services.AddScoped<ISchema, TestSchema>();
services.AddGraphQL(options =>
{
options.EnableMetrics = true;
options.ExposeExceptions = true;
})
.AddSystemTextJson()
.AddUserContextBuilder(context => new GraphQLUserContext { User = context.User })
.AddGraphTypes(typeof(TestSchema), ServiceLifetime.Scoped);
...
}
Error throw:
System.MissingMethodException: Method not found: 'Void GraphQL.ExecutionOptions.set_ExposeExceptions(Boolean)'.
at GraphQL.Server.Internal.DefaultGraphQLExecuter`1.GetOptions(String operationName, String query, Inputs variables, IDictionary`2 context, CancellationToken cancellationToken)
at GraphQL.Server.Internal.DefaultGraphQLExecuter`1.ExecuteAsync(String operationName, String query, Inputs variables, IDictionary`2 context, CancellationToken cancellationToken)
at GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware`1.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
What did I do wrong?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (18 by maintainers)
I am going to fix this next week or sooner.
I published 3.0.0.2026 . It works.
The server project is not updated to support the final release of 3.0.0 yet.