You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to gatsby. And learning this integration with wordpress. My config code is this
module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
author: `@gatsbyjs`,
siteUrl: `https://gatsbystarterdefaultsource.gatsbyjs.io/`,
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-image`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
{
resolve: `gatsby-source-wordpress`,
options: {
url: `http://localhost/phy/gatsby-wordpress/wordpress`,
protocol: `http`,
hostingWPCOM: false,
useACF: true,
schema: {
//Prefixes all WP Types with "Wp" so "Post and allPost" become "WpPost and allWpPost".
typePrefix: `Wp`,
},
develop: {
//caches media files outside of Gatsby's default cache an thus allows them to persist through a cache reset.
hardCacheMediaFiles: true,
},
type: {
Post: {
limit:
process.env.NODE_ENV === `development`
? // Lets just pull 50 posts in development to make it easy on ourselves (aka. faster).
50
: // and we don't actually need more than 5000 in production for this particular site
5000,
},
},
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
},
},
`gatsby-plugin-gatsby-cloud`,
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
}
error which i am getting is this
gatsby-source-wordpress GraphQL request was redirected to /phy/gatsby-wordpress/wordpress/
null
This can happen due to custom code or redirection plugins which redirect the request when a post is accessed.
This redirection code will need to be patched to not run during GraphQL requests.
That can be achieved by adding something like the following to your WP PHP code:
If you're still having issues, please visit https://www.wpgraphql.com/community-and-support/
and follow the link to join the WPGraphQL Slack.
There are a lot of folks there in the #gatsby channel who are happy to help with debugging.
not finished createSchemaCustomization - 1.262s
not finished gatsby-source-wordpress ensuring plugin requirements are met - 1.257s
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I am new to gatsby. And learning this integration with wordpress. My config code is this
error which i am getting is this
gatsby-source-wordpress GraphQL request was redirected to /phy/gatsby-wordpress/wordpress/
null
This can happen due to custom code or redirection plugins which redirect the request when a post is accessed.
This redirection code will need to be patched to not run during GraphQL requests.
That can be achieved by adding something like the following to your WP PHP code:
if ( defined( 'GRAPHQL_REQUEST' ) && true === GRAPHQL_REQUEST ) {
return examplePreventRedirect();
}
If you're still having issues, please visit https://www.wpgraphql.com/community-and-support/
and follow the link to join the WPGraphQL Slack.
There are a lot of folks there in the #gatsby channel who are happy to help with debugging.
not finished createSchemaCustomization - 1.262s
not finished gatsby-source-wordpress ensuring plugin requirements are met - 1.257s
Beta Was this translation helpful? Give feedback.
All reactions