-
-
Notifications
You must be signed in to change notification settings - Fork 328
Open
Labels
RFCRequest for commentsRequest for commentsenhancementexperimentalDeals with experimental features or changes that may not be published in ShopifySharp itselfDeals with experimental features or changes that may not be published in ShopifySharp itself
Description
I'm very interested in adding a "fluent" query builder for GraphQL queries/mutations. Here's what I envision it looking like:
var builder = new GraphQueryBuilder();
var pageInfoFragment = new GraphQueryFragmentBuilder("pageInfoFragment", pageInfo =>
pageInfo.StartCursor().EndCursor().HasNextPage().HasPreviousPage());
var query = builder.Query(query =>
query.Products(p =>
p.Arguments.First(10);
p.PageInfo(pageInfo => pageInfo.Fragment(pageInfoFragment));
p.Nodes(node =>
node.Id();
node.Title();
node.VariantsCount(v => v.Count());
)
.Shop(s =>
s.Id();
s.Title();
s.Plan(p => p.DisplayName());
)
).Build();
var request = new One of the things I like about this is the potential for reusing parts of the code (such as the pageInfo fragment). This is just pseudo-code so there are a lot of actual implementation questions that are unanswered here, but I'd love to hear feedback about this before I start implementing it (and don't forget to check #1137 and #1072 as well).
pandapknaepel, ajayak, timoheyden and ahinin79
Metadata
Metadata
Assignees
Labels
RFCRequest for commentsRequest for commentsenhancementexperimentalDeals with experimental features or changes that may not be published in ShopifySharp itselfDeals with experimental features or changes that may not be published in ShopifySharp itself
Projects
Status
In Progress