0

I'm creating a new Gutenberg ACF Block. I want to be able to dynamically provide a list of Post objects in GraphQL for Gatsby to read.

Here is my code which works in WordPress GraphiQL and in Gatsby's GraphQL to return a single Post.

Gutenberg Block Code: enter image description here

Gatsby GraphQL: enter image description here

But if I change it to return a list of Posts, this does work in WordPress GraphiQL but returns an empty list in Gatsby's GraphQL.

Gutenberg Block Code:

enter image description here

WordPress GraphiQL:

enter image description here

Gatsby GraphQL:

enter image description here

I'm using gatsby-source-wordpress-experimental 1.3.8 for Gatsby.

Am I wrapping the list of Post objects wrong? Has someone else ever provided a list of Post types in WP GraphQL before?

Ourx
  • 109
  • 3
  • 15

1 Answers1

0

Here's how you can solve this problem:

enter image description here

Happy coding!

Ourx
  • 109
  • 3
  • 15