0

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?

Ian Kirkpatrick
  • 1,861
  • 14
  • 33

1 Answers1

0

Figured out that Hot Chocolate has not added support for pagination/sort/filter on schema first projects. We are doing schema first so we have to implement it ourselves.

Ian Kirkpatrick
  • 1,861
  • 14
  • 33