Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Compatibility with WPGraphQL v0.4.0 #60

Closed
5 tasks
jasonbahl opened this issue Sep 11, 2019 · 0 comments
Closed
5 tasks

Compatibility with WPGraphQL v0.4.0 #60

jasonbahl opened this issue Sep 11, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jasonbahl
Copy link
Contributor

jasonbahl commented Sep 11, 2019

WPGraphQL v0.4.0 (upcoming) introduces some breaking changes to the TypeRegistry.

WPGraphQL for ACF will need some updates to play nice with the core WPGraphQL update.

The update to WPGraphQL v0.4.0 enables the GraphQL Schema to be cleared properly, enabling better integration tests with Codeception, which will severely increase the code quality of the core plugin and extensions such as ACF.


The changes needed for this extension to play nice are pretty minor:

  • Hook the main Config to init_graphql_type_registry instead of graphql_register_types
  • Have the Config class accept TypeRegistry as an argument, and set it in the class as a class var
  • Replace instances of TypeRegistry:: static method calls with $this->type_registry (using the ^ instance passed into the class)
  • Replace the resolveType methods to use the type_registry passed to the class instead of static Types:: methods
  • Refactor tests to be more granular (the result and primary goal of the new WPGraphQL::__clear_schema() ability). . .now tests can be MUCH more granular, readable, and maintainable, instead of registering everything all up front, individual tests can register exactly what they need!
@jasonbahl jasonbahl self-assigned this Sep 11, 2019
@jasonbahl jasonbahl added Breaking Change enhancement New feature or request and removed Breaking Change labels Sep 11, 2019
jasonbahl added a commit to jasonbahl/wp-graphql-acf that referenced this issue Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant