Skip to content

Build error on Gatsby when activate WPGraphql with Gravity Form #448

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

Open
2 of 3 tasks
suhailsola opened this issue Dec 19, 2024 · 5 comments
Open
2 of 3 tasks

Build error on Gatsby when activate WPGraphql with Gravity Form #448

suhailsola opened this issue Dec 19, 2024 · 5 comments
Labels
status: needs info 🔎 Needs more info before action can be taken

Comments

@suhailsola
Copy link

Description

Error received on Gatsby

` ERROR
#gatsby-source-wordpress_111007
PLUGIN

gatsby-source-wordpress Request failed with status code 500

Your WordPress server is either overloaded or encountered a PHP error.

Error occurred while fetching nodes of the "GfEntry" type.`

Debug.log on Wordpress

[19-Dec-2024 03:53:25 UTC] PHP Notice: Undefined index: GfFieldChoice in C:\laragon\www\site\wp-content\plugins\wp-graphql\vendor\webonyx\graphql-php\src\Type\Schema.php on line 437

Error happens when I activate the WPGraphql for Gravity Form

Steps to reproduce

  1. Wordpress PHP : 7.4.33
  2. gatsby-source-wordpress: 7.13.5
  3. Gravity form : 2.7.7
  4. WPGraphQL: 1.29.3
  5. WPGraphQL for Gravity Forms: 0.13.0.1

Need to run wordpress and gatsby

Additional context

No response

Plugin Version

0.13.0.1

Gravity Forms Version

2.7.7

WordPress Version

6.5.5

WPGraphQL Version

1.29.3

Additional enviornmental details

Running on Gatsby v5.13.7

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for Gravity Forms, WPGraphQL, and WPGraphQL for Gravity Forms

  • Yes
  • My issue is with a specific 3rd-party plugin.
@justlevine
Copy link
Member

Thanks for reporting this @suhailsola .

TBH I thought gatsby-source-wordpress was abandoned. 🙈

Doesn't seem like the PHP Notice is directly related to your 500 error (both because PHP Notices don't throw a 500, and because GFFieldChoice is an object that only attaches to Form Field objects, and not GFEntry.

Additionally I recommend you follow these debugging steps: specifically trying to replicate the query first in Gatsby's Playground, and then in the WPGraphQL IDE (note: you'll need to translate those automagical Gatsby field renames to what used by vanilla GraphQL). This will both narrow down the error to a specific part of the schema as well as determine if it's a bug in gatsby-source-wordpress or something we can address here.

@justlevine justlevine added the status: needs info 🔎 Needs more info before action can be taken label Dec 24, 2024
@suhailsola
Copy link
Author

Thanks for reporting this @suhailsola .

TBH I thought gatsby-source-wordpress was abandoned. 🙈

Doesn't seem like the PHP Notice is directly related to your 500 error (both because PHP Notices don't throw a 500, and because GFFieldChoice is an object that only attaches to Form Field objects, and not GFEntry.

Additionally I recommend you follow these debugging steps: specifically trying to replicate the query first in Gatsby's Playground, and then in the WPGraphQL IDE (note: you'll need to translate those automagical Gatsby field renames to what used by vanilla GraphQL). This will both narrow down the error to a specific part of the schema as well as determine if it's a bug in gatsby-source-wordpress or something we can address here.

Hi @justlevine , thank you for taking the time to review this. I've followed the debug steps and replicate the query for inside the WPGraphQL IDE and received this error

"debugMessage": "Return value of GraphQL\Type\Schema::getImplementations() must be an instance of GraphQL\Utils\InterfaceImplementations, null returned",
"message": "Internal server error",
"extensions": {
"category": "internal"
},

GfEntry_list-all-query.txt

I've added the file for the query that is receiving error here

@kenseiatwork
Copy link

@suhailsola Are you updating from a wp-graphql version before 1.28? You might want to check out this change in wp-graphql that was made in 1.28.0

wp-graphql/wp-graphql#3172

Specifically, the change made in Registry/TypeRegistry.php
wp-graphql/wp-graphql@de2e5f2#diff-fea80346fad1aa40b8c8872a4d3a8f73a343b677fe4e8410e1224fcfb502a1a5L717

The extra check for the introspection_query might be causing setting the eager_type_map array to get skipped over.

@suhailsola
Copy link
Author

@suhailsola Are you updating from a wp-graphql version before 1.28? You might want to check out this change in wp-graphql that was made in 1.28.0

wp-graphql/wp-graphql#3172

Specifically, the change made in Registry/TypeRegistry.php wp-graphql/wp-graphql@de2e5f2#diff-fea80346fad1aa40b8c8872a4d3a8f73a343b677fe4e8410e1224fcfb502a1a5L717

The extra check for the introspection_query might be causing setting the eager_type_map array to get skipped over.

No, I am not updating from any old version, I installed the latest version available as I am working on my project

@justlevine
Copy link
Member

@suhailsola - ken's recommendation above is to see if downgrading to WPGraphQL core < 1.27.x fixes things for you.
If so that would reduce the scope of possible causes and make it more likely to be able to ship a fix (either here or upstream if it's a bug in WPGraphQL core's codebase)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs info 🔎 Needs more info before action can be taken
Projects
None yet
Development

No branches or pull requests

3 participants