I have a Query:
public class Query : ObjectType
{
protected override void Configure(IObjectTypeDescriptor<Query> descriptor)
{
Console.WriteLine("Hit Configure");
}
public IQueryable<DataStory> GetDataStories([Service]MicipContext context)
{
return context.DataStories;
}
}
And in Startup.cs:
public void ConfigureServices(IServiceCollection services)
{
services.AddGraphQL(sp =>
{
var schema = SchemaBuilder.New()
.AddDocumentFromString(this.ReadSchema())
.BindResolver<Query>(c => c.To<Query>())
.AddServices(sp)
.Create();
return schema;
}
}
And my schema graphql:
type Query {
dataStories: [DataStory!]!
}
type DataStory {
id: Int!
title: String!
}
When I call the query with:
query GetDataStories {
dataStories {
title
}
}
The resolver returns correctly but my configure method is never called. What am I doing wrong? Shouldn't Configure be called at some point?