Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // In startup.cs
- var schema = FederatedSchema.For(
- schemaString
- _ =>
- {
- _.Types.Include<Query>();
- _.Types.Include<Mutation();
- ...
- };
- services.AddTransient<Query>().AddTransient<Mutation>().AddSingleton(schema);
- // In Query.cs
- public class Query
- {
- private readonly IDataProvider provider;
- public Query(IDataProvider provider)
- {
- this.provider = provider;
- }
- }
- // Exception received:
- No parameterless constructor defined for type 'Query'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement