graphql crud sample

GraphQL with ASP.NET Core (Part- X : Data Loader - Series Finale)

Read the previous part - GraphQL with ASP.NET Core (Part- IX : Entity Relations - Many to Many) Our GraphQL queries are not quite optimized. Take the Orders query from CustomerType for example, CustomerType.cs Field<ListGraphType<OrderType>, IEnumerable<Order>>() .Name("Orders") .ResolveAsync(ctx => { return dataStore.GetOrdersAsync(); }); Here, we are getting all the orders from the data store. This is all fun and games till you stay in the scaler zone of OrderType i.e. only querying the scaler properties of OrderType. But…

Keep reading

GraphQL with ASP.NET Core (Part- VII : Mutation)

Read the previous part - GraphQL with ASP.NET Core (Part- VI : Persist Data - Postgres with EF Core) We've been dealing with data fetching so far. But how do you cause side effects on the server-side data? Side effects can be anything ranging from a data insertion, patching, deletion or update. GraphQL mutation is just the thing you are looking for here. Before we move forward, I would like to do a bit of housekeeping on the project. So, I've changed the name of the HelloWordQuery object graph type…

Keep reading