AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Public async Task Post( GraphQLRequest graphQlRequest)ĮxecutionOptions executionOptions = new ExecutionOptions() Public GraphQLController(ISchema schema, IDocumentExecuter documentExecuter) Private readonly IDocumentExecuter _documentExecuter Public sealed class GraphQLController : Controller The corresponding GraphQL request DTO public sealed class GraphQLRequest In the startup file in the ConfigureServices I added this code to register all the required services before calling services.AddControllers() serviceCollectionĪnd in the Configure method I call app.UseGraphiQl() at first. Public GraphQLSchema(GraphQLQuery graphQLQuery, IServiceProvider serviceProvider) : base(serviceProvider) Private readonly List _tasks = new List() Īnd register that query for the schema public sealed class GraphQLSchema : Private readonly List _users = new List() I created the query holding all the "actions" the client can execute public sealed class GraphQLQuery : ObjectGraphType Public sealed class TaskType : ObjectGraphTypeįield(task => task.Id).Description("The task id.") public sealed class UserĪnd both of them have their representing graph type public sealed class UserType : ObjectGraphTypeįield(user => user.Id).Description("The user id.") When running the application this is what I getīesides the exception message GraphiQL wasn't able to find a schema documentation.įirst of all I have two entities, users and tasks. NET Core project and installed the packages GraphQL, GraphiQL and GraphQL.SystemTextJson.
0 Comments
Read More
Leave a Reply. |