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

Fragment error after adding Flexible Content to a page #239

Open
3 tasks done
smorfe opened this issue Sep 14, 2024 · 1 comment
Open
3 tasks done

Fragment error after adding Flexible Content to a page #239

smorfe opened this issue Sep 14, 2024 · 1 comment
Assignees
Labels
close candidate Needs confirmation before closing

Comments

@smorfe
Copy link

smorfe commented Sep 14, 2024

Description

I just added flexible content field to one of my templates and after I input some content in, I tried building my local it keep giving me this error on my terminal:

 ERROR  UNKNOWN

 gatsby-source-wordpress  (undefined) location: line 644, column: 12. location:
line 1007, column: 12
	 Cannot spread fragment "ContentNodeFragment" within itself via
PageFlexibleContentFragment.

 Error path: undefined

 If you haven't already, try adding define( 'GRAPHQL_DEBUG', true ); to your
wp-config.php for more detailed error messages.


 ERROR  UNKNOWN

Error from GraphQL IDE:

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

Steps to reproduce

n/a

PHP or JSON export of the ACF Field Group(s)

acf-export-2024-09-14.json

Additional context

No response

WPGraphQL Version

1.28.1

WPGraphQL For ACF Version

2.4.1

ACF (Advanced Custom Fields) Version. Free or Pro?

v6.3.6 Pro

WordPress Version

6.6.1

PHP Version

8.2

Additional enviornment details

No response

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

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL, WPGraphQL For ACF, ACF, etc.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@jasonbahl
Copy link
Contributor

jasonbahl commented Sep 16, 2024

@smorfe according to the error, you are trying to nest a fragment within itself which could lead to infinite recursion and the error is telling you that you cannot do this. If you share your query, I can help you refactor it to something that would work, but the issue is that the ContentNodeFragment is being used as a child of itself which will lead to infinite recursion, so the query and fragment need to be changed to avoid recursion.


It looks like you're using Gatsby which auto-generates queries, so you might have to play around with the Gatsby Source WordPress options to configure things to avoid this problem. see: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/docs/plugin-options.md

@jasonbahl jasonbahl self-assigned this Sep 16, 2024
@jasonbahl jasonbahl added the close candidate Needs confirmation before closing label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
close candidate Needs confirmation before closing
Projects
None yet
Development

No branches or pull requests

2 participants