4- In the gatsby-config.js of the starter you just set up, update the plugin options for gatsby-source-wordpress-experimental.
change the url option so that it points to your WordPress instance GraphQL url. This should be the full url of your GraphQL endpoint. Eg https://yoursite.com/graphql
5- Run gatsby develop and experience the magic 馃専
I created a new Wordpress site using Local from flywheel, and while everything works fine, but createPages() assume that permalinks are formatted in %year%/%month%/%day%/%post-name%/ format.
Ah, you mean for the starter? I believe it's using the WPGraphQL uri field which is taken from the WP permalinks. Or maybe am I misunderstanding what you mean?
The problem is that by default WP instance on flywheel at least, uses plain permalink /?p=id this creates a page reachable with the path ?p=1 which doesn't work!
I will close this issue as it is not a very big deal. I am more concerned about the starter for other reasons e.g
gatsby-source-wordpress-experimental": ">=0.8.3, which means sourcing images fail.Thanks @Nazeh , I think you're right though that it should be mentioned in the docs. I'm going to re-open if you don't mind (just to track this and not forget).
@jasonbahl I'm guessing the answer is no, but is there a way to query for the permalink structure? It'd be nice to check the permalink structure and error with instructions if pretty-permalinks aren't enabled.
@Nazeh I'm also working on an official theme right now and then I'll be using it to improve the starter. The current starter isn't very good as it was built very quickly to test the source plugin. I'll be spending more time on improving it this week.
@jasonbahl or maybe I can detect in WPGatsby if pretty permalinks aren't set and add a WP error notice to all pages saying to change the permalink structure 馃
Permalink structure is not currently exposed in WPGraphQL.
We'd need to think about the best way to expose it. Shape of data, and who should be able to access it. Gut instinct is that it could be fully public, but not sure.
So my current thinking on this is to add to WPGatsby's schema a field that just returns wether or not pretty permalinks are enabled. If they're not, the source plugin should throw a large warning. Additionally on the WP side, WPGatsby should add a wp error notice to the top of every page if WPGatsby is active but pretty permalinks are not enabled.
This should also be added to the quick start steps and tutorial.
I've added a warning in [email protected] if pretty permalinks are disabled. I've left it out of the docs because many folks wont run into this problem, so I think we should just guide them to a solution if this is a problem in their case.
Thanks for raising this issue @Nazeh !