Solving broken builds when updating WPGraphQL #1461
Replies: 9 comments
-
Maybe an option would be to somehow cache the schema so requests still get the same response for a few minutes whilst the backend and frontend get back into sync. Another option would be to try and handle schema updates on the frontend. An example is when we went to I do think that as soon as we hit 1.0 that this problem will be gone until 2.0 but then we can plan ahead of time for that. I personally believe that this might be a lot of overhead that semver mostly solves. |
Beta Was this translation helpful? Give feedback.
-
Very possible. I don't think it does entirely, so I thought I'd bring it up for discussion. |
Beta Was this translation helpful? Give feedback.
-
Another option could be to allow a way to run two different versions on different endpoints so something like |
Beta Was this translation helpful? Give feedback.
-
@seagyn This crossed my mind. I'm curious if it'd be possible to do this with headers instead of routes. Example: you add a I'm really curious what Jason has to say, he probable can think of a hundred things that affect this idea that may make it difficult or impossible. |
Beta Was this translation helpful? Give feedback.
-
I don't think it's that straight forward unless we want to take on a LOT of technical debt. I did outline a "Seamless Upgrade Path" plan in the 1.0 release plan here: #1357 Where for some breaking changes at least, we could follow a 3-release approach:
There's also this library that looks interesting: https://github.com/ef-eng/graphql-query-rewrite We could explore some way for folks to be able to alias old queries in some way. This will allow for WPGraphQL to move forward without maintaining gobs of tech debt, but allow each project the ability to safely move forward even if/when WPGraphQL core does make breaking changes. |
Beta Was this translation helpful? Give feedback.
-
I think there's also a lot more room for tooling we can explore. Things like persisted query logging, so folks can track the query operations being made to their servers and when Schema changes are introduced they can identify which queries would break. |
Beta Was this translation helpful? Give feedback.
-
I knew Jason would have a highly intelligent answer for me. Thanks, sounds like it's on your mind and it'll get solved when it needs to. Feel free to close this issue, or whatever. |
Beta Was this translation helpful? Give feedback.
-
@moonmeister I'll probably leave it open to get more discussion. I don't think it's a solved thing by any means yet. |
Beta Was this translation helpful? Give feedback.
-
@moonmeister I'm transferring this to a discussion as it seems like a more open-ended topic right now. I think it's a good conversation to have that might stem many different ideas. It's for sure not a "solved" problem in the WPGraphQL space or even broader GraphQL space. |
Beta Was this translation helpful? Give feedback.
-
Problem
I've seen a consistent issue with maintaining WPGraphQL on a production site. This: If I update WPGraphQL in WP my site build is broken until I'm able to update the front-end code. If I can use a dev version of WP to update WPGraphQL then I can update the front-end without affecting prod builds. But, eventually there will come a moment where I need to update WPGraphQL in prod and then merge the front-end changes. Even if that's only a couple minutes that's time where builds can be broken. On small static sites this isn't a huge problem, on large sites this may break publishing and previews for that time period (or if it's not statically generated, it might actually break the front-end of any site/client).
Possible solutions
Would it be possible...To allow installing multiple versions of WPGraphQL side-by-side. Not sure the specifics of this, but this would allow old versions of the site to continue working against older versions of WPGraphQL and new versions to to the new WPGraphQL API.
Things I've been thinking about:
@jasonbahl You may have a better less complicated solution but I've seen this my own site (I'm one person with a static site so not a big issue but it's a real problem with the Gatsby site. Kyle G and I were talking about it today so I thought I'd mention it. 🤷♂️
Beta Was this translation helpful? Give feedback.
All reactions