WPGraphQL Updates – October 23, 2019
By Jason Bahl
October 23rd, 2019
This week no attendees were able to join the Zoom call, so there is no recording. Instead, I recapped some things happening with WPGraphQL in Slack. Below are the notes shared in Slack.
This release is centered around making testing, specifically the testing of extensions, easier. The current WPGraphQL makes use of a lot of static methods and that makes testing extensions very difficult. This release refactors a lot of internals to drastically reduce the amount of static methods being used and makes it much easier for extending plugins to test.
For users that are using WPGraphQL with no extensions, there will likely be no disruption. However, if you’re using any plugins (or custom code) that extend WPGraphQL, there’s a chance you may need to make some code changes to remain compatible. If you’re calling static methods of the TypeRegistry or Types class directly, there’s a chance your uses of those methods will no longer work. If you run into issues and the below upgrade guide doesn’t help resolve it, please post an issue in Github and I’ll do my best to help point you to a solution to get your code compatible.
If you need to access methods from the TypeRegistry, the TypeRegistry class is now passed down to the
graphql_register_types action, so you can access things from the TypeRegistry from the context of that hook.
Would need to change to:
If you were already using the
register_graphql_* APIs, they should be backward compatible, but please let me know if you do run into issues that you cannot resolve with this update.
The v0.4.0 had the potential to break extension plugins, so I did a sweep of the WPGraphQL Extension plugins that I maintain, and updated them to make sure they play nice with WPGraphQL v0.4.0.When WPGraphQL v0.4.0 is released, I will simultaneously release updates for the following extensions:
- WPGraphQL for Advanced Custom Fields
- WPGraphQL JWT Authentication
- WPGraphQL Insights
- WPGraphQL Meta Query
- WPGraphQL Tax Query
Shortly after the release of WPGraphQL v0.4.0 we’ll have a new docs site. Tyler Barnes is hard at work getting the docs updated to make use of the same Gatsby theme the Apollo Docs are on. This will allow us to take advantage of some nice features they add upstream and we can focus on the content.
Once the transition to the new Gatsby theme for the docs is complete, We’ll be working on adding a new “Recipes” section and filling in some missing documentation for the
register_graphql_* APIs, among other improvements.
The docs site will also be moving into the main repo so that the docs can be coupled more tightly to the version of the codebase they represent.
This way, if a feature changes something that should be documented, we can ensure we merge PRs that also have relevant documentation changes.
Recently merged the Code Exporter feature to WPGraphiQL.
If you will be at WordCamp US, please let me know as I’d love to connect!