Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR demonstrates that 3rd party plugins cannot be added and access state from Graph_i_QL because of the structure of GraphiQL and the reliance on GraphiQL Context providers, etc.
in the legacy WPGraphQL IDE, we had our own context provider that maintained the Query and Schema and passed it down to GraphiQL and the Query Composer (which was not a child of GraphiQL).
But in the new GraphiQL, the "plugins" are expected to be children of and access state from GraphiQL.
This pattern doesn't lend well to what we're trying to do by having plugins enqueued from third parties and access the same state.
This relates to why we need redux in the first place. . .and why Gutenberg adopted redux (see: #47, #41)
Anyway, right now I don't see a path forward that allows 3rd parties to hook in and do anything meaningful because they can't access state unless they're truly a child of the larger GraphiQL component.
Hopefully I'm wrong and you can prove there's another way? 🤞🏻
I think the path forward, in my eyes, is to lift all the state that GraphiQL maintains (Schema, Query, isFetching, tabs, etc) into the redux store, then re-construct GraphiQL with the same components, but with state from Redux.
This would allow 3rd party components (i.e. composer, faust extensions, etc) to access the state and do something with it.
for context, this is a screenshot of the IDE after you click on the "Explorer" extension.