Right now if multiple instances of the source plugin are used within a single Gatsby site each instance will overwrite the redux store of the other (there's only 1 store). This should remain as 1 store so we can communicate between plugin instances, but state and actions should be scoped by typePrefix.
Hi @TylerBarnes I have just realised that I'm experiencing some pain in regards to this. Is there a current way to make this work or can I help with the implementation of this?
@hellola I appreciate your willingness to help! In this case I think it's probably best for me to make this change since it requires changing pretty much every area of the codebase 馃槺 . I'm planning on doing this once I have some more solid integration tests (currently working on that).
@jasonbahl and I were discussing this and it looks like this is actually a bigger job than I originally anticipated. Since this plugin is using the id's from WPGraphQL directly, and WPGQL doesn't make id's unique across sites (yet), it will be really hard to implement this. For now we should implement https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/issues/251 and wait for WPGraphQL to make id's unique to properly support this.
Hey @TylerBarnes is there an issue in WPGQL that we can link here for the unique ID's?
Alternatively, I'm not sure WPGQL will be able to provide unique ID's across all sites. Cause WP doesn't even do that. If I have two new WP sites, and create a menu in each site, WP will give them the same ID. So I am not sure WPGQL is going to be able to abstract that further?? I'm not sure I'm being super clear.
But maybe there's something we can do on the Gatsby side that uses the siteName or siteID along with the GQL node ID's?
I helped solve this issue for the REST API
https://github.com/gatsbyjs/gatsby/pull/12683
WPGQL will make them unique by encoding the URL as part of the id. Right now WPGQL encodes the post type + database ID. WPGQL needs to do this to properly support multi-site anyway so I think we should keep it simple and wait for WPGQL to make them unique.
We recently moved this plugin over to the gatsbyjs monorepo and are trying to clean out this issue queue. We documented this feature to look at for a future roadmap item and are going to close this issue out. If you want to add additional visibility to this feature, you can request it at https://portal.gatsbyjs.com/