0

The gatsby-source-wordpress Gatsby plugin offers an option to filter a type using a "where" clause.

For example:

type: {
    MyType: {
        where: `id: 12345`
    }
}

Supposing I wanted to filter the data on a nested sub-field, is there any way to accomplish this through the plugin? Anything I've tried throws errors for unexpected characters, so I can start with a curly brace.

I'd love to be able to do something like the following:

type: {
    MyType: {
        where: `
            myCustomCategory {
                nodes {
                    metaData {
                        showOnHomePage: true
                    }
                }
            }
        `
    }
}

It always expects a ":" to follow the name, though. I also tried wrapping the whole thing in curly braces, to no avail.

Is what I'm attempting impossible?

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
TonyTheJet
  • 517
  • 1
  • 6
  • 15

0 Answers0