gatsbyjs/gatsby-source-wordpress-experimental

Add an API to skip fetching data for a field and resolve gatsby-side / add nested field Gatsby filters

Closed this issue · 0 comments

For example, in the User.posts field we're currently fetching the id's of all connected nodes (up to 100 of them). This isn't necessary because we already know that Post nodes will have an author field and we can use that to resolve which nodes should be connected. Resolving this locally will also allow us to resolve more than 100 connected nodes.

The api might look something like:

{
  options: {
    type: {
      Author: {
        resolveLocalConnections: [
          {
            fieldName: `posts`,
            connectBy: `Post.author.node` // should be a 1:1 connection field back to the Author type.
          }
        ]
      }
    }
  }
}

Default options for this should be included for obvious fields like User.posts and wherever else makes sense.