Can we version graphql query | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sarav_prakash

Persisted queries url gets cached. So versioning of query is creating new url, not available in cache. Currently in our project, we duplicate the queries to v2 like this 

This way old clients will continue using v1 version and new clients can switch to v2. 

 

Remember, non-breaking changes, like adding new fields, dont require versioning. Since clients would simply ignore new field. But breaking changes, like changing modal, removing fields, changing filters etc, will break existing clients and has to be versioned. 

1 reply

sarav_prakash
Community Advisor
sarav_prakashCommunity AdvisorAccepted solution
Community Advisor
January 20, 2025

Persisted queries url gets cached. So versioning of query is creating new url, not available in cache. Currently in our project, we duplicate the queries to v2 like this 

This way old clients will continue using v1 version and new clients can switch to v2. 

 

Remember, non-breaking changes, like adding new fields, dont require versioning. Since clients would simply ignore new field. But breaking changes, like changing modal, removing fields, changing filters etc, will break existing clients and has to be versioned.