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

Accessing gutenberg blocks will break next/prev queries #52

Open
drewbaker opened this issue Mar 14, 2023 · 2 comments
Open

Accessing gutenberg blocks will break next/prev queries #52

drewbaker opened this issue Mar 14, 2023 · 2 comments
Assignees

Comments

@drewbaker
Copy link
Member

So depending on where you use GutenbergBlocks in the GQL document, it will break nextPost or previousPost queries.

For example, previousPost and nextPost will be null when accessed like this:

#import "~/gql/fragments/GutenbergBlocks.gql"

query NewsDetail($uri: String!) {
    nodeByUri(uri: $uri) {
        id
        ... on Post {

            ...GutenbergBlocks

            previousPost {
                node {
                    ... on Post {
                        id
                    }
                }
            }
            nextPost {
                node {
                    ... on Post {
                        id
                    }
                }
            }
        }
    }
}

But if you move ...GutenbergBlocks to be after nextPost then they work fine. This might be related this function in our theme, but I doubt it: https://github.com/funkhaus/fuxt-backend/blob/master/functions/gql-functions.php#L229

@rsm0128
Copy link
Collaborator

rsm0128 commented Mar 17, 2023

@drewbaker I can't replicate the error on my end. I test it on my local, but it works fine on my local.
Could you provide me the Post content so that I can test it correctly.
Thanks!

@drewbaker
Copy link
Member Author

I think this is going to be a hard thing to debug, because it probably depends on the contents of the blocks... next time I run into it I will capture here.

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