Skip to content
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

limit the impact of a subgraph change, allowing as much as possible the previous version of core-sdk to continue working. #716

Open
levalleux-ludo opened this issue Apr 15, 2024 · 0 comments

Comments

@levalleux-ludo
Copy link
Member

Most of the times, when a subgraph schema change happens, the previous versions of core-sdk doesn't work anymore, due to missing properties in the subgraph request.
This is mostly due to the fact that the implementation of the subgraph requests is auto-generated (use of graphql-codegen), leading to get all properties always required even when not functionally needed.

In order to allow, as much as possible, the old core-sdk versions to still work with new subgraphs, we could limit the fetched properties only to those functionally required for the services.
For example, the WooCommerce plugin fetches a seller based on a wallet address, using bosonSDK.getSellersByAddress(address) which calls the subgraph query getSellersQuery(), querying all properties SellerFields (https://github.com/bosonprotocol/core-components/blob/main/packages/core-sdk/src/accounts/queries.graphql#L286). However, what needs the WooCommerce plugin is only the seller.id. So in that case all other fields queried are useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant