-
Notifications
You must be signed in to change notification settings - Fork 122
error in gatsby-node js on active plugin in the wordpress #169
Comments
@tinelli22 this looks like perhaps you've added an ACF Field Group with an empty Can you make sure any field groups you have in ACF have a GraphQL Field Name set? |
I create only one, following your example on "WPGraphQL for ACF" youtube |
I'm getting this same error on
The GraphQL Field Name is populated and it's showing up in the WPGraphiQL explorer but when I go to build/develop with Gatsby it's throwing this error. ACF Settings: WPGraphiQL Explorer: Gatsby Develop/Build Error: Any ideas what this might be causing this? |
Can you provide exports of your ACF field groups? Perhaps there's something in the Field Group registration that can help replicate this. |
@hashinteractive are you also using Custom Post Type UI and WPGraphQL for Custom Post Type UI by chance? |
@jasonbahl thanks for taking a look. I'm not using Custom Post Type UI I believe it had something to do with when the fieldGroup was saved the fieldGroup name (for graphql schema) was somehow saved as empty (even though I had filled out the GraphQL Field Name) and even if I changed/updated the GraphQL Field Name it still was throwing this error (despite clearing data cache using gatsby clean). Tyler addressed this issue and might be resolved on Gatsby side: gatsbyjs/gatsby-source-wordpress-experimental#169 I had to resolve this by creating a new instance of WordPress, installed required plugins (WP GraphQL, WP Gatsby) and porting data over. It was early on in the project so I wasn't too far in so it wasn't a big deal for me but anyone further along in a project getting this error might have other concerns. |
Ok. Interesting. Ya, my only thought is that somehow some ACF Field Groups were saved with I'll see if I can reproduce this and guard against it. |
That might have been the case, I have not done any programmatic definition for the the ACF Field Group such as |
WPGraphQL v0.5.0 has a lot of improvements to the settings fields. I've not been able to reproduce this issue, even pre-v0.5.0, but I believe the changes to v0.5.0 guard against this even more. I'm going to close this, but if the issue persists after v0.5.0, please open a new issue with clear steps to reproduce and we'll look into it further. |
When I active the plugin wp-graphql-acf-master, my gatsby project in gatsby-node.js launch this error:
const { data } = await graphql(`
Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]$/ but "" does not.
Names must match /^[_a-zA-Z][_a-zA-Z0-9]$/ but "" does not.
graphql-runner.ts:98 GraphQLRunner.validate
[...]/[gatsby]/src/query/graphql-runner.ts:98:22
graphql-runner.ts:162 GraphQLRunner.query
[....]/[gatsby]/src/query/graphql-runner.ts:162:25
create-graphql-runner.ts:59
[...]/[gatsby]/src/bootstrap/create-graphql-runner.ts:59:8
gatsby-node.js:58 Object.exports.createPages
------//-----
A part of the code:
exports.createPages = async ({ actions, graphql }) => {
const { createPage } = actions
......
const PostTemplate = path.resolve(
./src/templates/blog/Post/index.js
)const { data } = await graphql(`
.............
..................
}
The text was updated successfully, but these errors were encountered: