-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GraphQL service classes with pre-generated methods matching Shopify's queries and mutations #1137
Comments
We are using ShopifySharp package in our Shopify Integration system for almost 2 years now, awesome project and is very helpful in our system integration. As Shopify is moving GraphQL, we are also trying to upgrade our integration system to consume GraphQL endpoints instead of REST. We have upgraded to ShopifySharp to latest 6.21.0, and was able to use IGraphService to make the GraphQL calls. Will this feature build a list of services and methods similar to, what we have in REST API for the seamless integration through services like FulfillmentOrderService, InventoryLevelService. This will help us connect to Shopify endpoints to get the responses without writing a query (may be just to get to base properties, if we want more we can override it with a query). A similar implementation in REST APIs, with tightly coupled models helped us a lot in the past when Shopify deprecated few properties and helped us mitigate the data issues. Please let us know if there a plan to build GraphQL services similar to REST service and what would be release plan if you planning to support it. |
Hey @AgnalVictoria, thanks for the feedback! Yes, that would be the plan: a similar implementation to what ShopifySharp has for the REST APIs right now; tightly coupled models that match up with services for different topics (e.g. a |
Sounds great, that would make all the integrations seamless. Please let know if there is a timeline we can expect them in the upcoming releases. Thank you |
We are using your project and are very thankful for all the work you put int. Just wanted to bring some attention to this issue as I think it would help us and many others make the transition to GraphQL much more smooth. I understand that there are many issues that still needs to be solved for ShopifySharp to be fully ready for 100% GraphQL, but if possible I think this issue should be prioritized since it helps bridge the gap between current implementation using the REST Api and the GraphQL implementation, seeing as a lot of the work lies in writing queries to fetch the needed objects. Thank you |
Thanks for the feedback @sgpeak! I've been working on rewriting all of the projects in my Shopify Development Handbook that I wrote several years ago, and after going through just one of the seven projects in that book I agree with you that almost all of the work lies in the actual writing of graph queries. I'm going to officially say that this is now a planned feature – I want to be able to instantiate a new There will be a lot of work to do to get there, but it's going to be my priority going forward. I'm also going to include it in ShopifySharp itself instead of a separate package. |
The idea here would be to create a second ShopifySharp package that builds off of and extends the base ShopifySharp package with extra niceties, kind of like the current ShopifySharp.Extensions.DependencyInjection adds DI extensions that aren't included in ShopifySharp itself.
In this case, the hypothetical package would be called something like ShopifySharp.Graph.GeneratedServices (name not final), and it would contain a litany of service classes that line up more or less with the current REST services in ShopifySharp. However, instead of methods matching the REST API endpoints, the methods in these classes would match up with the queries and mutations in Shopify's GraphQL API.
So, for example, the package would contain a
ProductService
class that implements the following interface:These methods would largely be generated automatically via source generator, and a Github Action could be scheduled to scan for changes to the GraphQL schema every [day|week] to regenerate the classes and push a new update to Nuget (after review).
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. Is this something you'd find useful? If so, let me know! And don't forget to check #1132 and #1072 as well.
The text was updated successfully, but these errors were encountered: