Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-source-wordpress] Single API endpoint #5064

Closed
MYKEU opened this issue Apr 20, 2018 · 3 comments
Closed

[gatsby-source-wordpress] Single API endpoint #5064

MYKEU opened this issue Apr 20, 2018 · 3 comments

Comments

@MYKEU
Copy link

MYKEU commented Apr 20, 2018

Hey,

I've just started to use this plugin and I noticed that it automatically pulls in data from all WP's API endpoints - this ends up taking quite a long time.

Is there any way of only pointing to a single API instead? Or is this not possible?

@KyleAMathews
Copy link
Contributor

You can use the excludedRoutes option to stop fetching from APIs you don't wish to fetch from:

https://www.gatsbyjs.org/packages/gatsby-source-wordpress/?=wordpres#how-to-use

@MYKEU
Copy link
Author

MYKEU commented Apr 20, 2018

Thanks @KyleAMathews !

Do you also know if it is possible to change it so that it only pulls from a certain page endpoint by its id; for example: https://example.wordpress.com/wp-json/wp/v2/pages/1939

@KyleAMathews
Copy link
Contributor

No — something that specific might be best done in your own plugin where you fetch exactly what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants