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

Allow index to be fetched based on fieldName #50

Open
QUzair opened this issue Jun 28, 2022 · 0 comments
Open

Allow index to be fetched based on fieldName #50

QUzair opened this issue Jun 28, 2022 · 0 comments

Comments

@QUzair
Copy link

QUzair commented Jun 28, 2022

Having issues for pulling separate indexes for different pages.

Current:

/my-site/page1

query SearchbarIndexQuery {
  localSearchPage1 {
    index
    store
  }

/my-site/another-page

query SearchbarIndexQuery {
  localSearchAnotherPage {
    index
    store
  }

Preferred:

query($indexName: String) {
  localSearchPages(filter: {indexName: {eq: $indexName}}) {
    index
    store
  }

Because gatsby tries to validate pageQueries on compile time the current version requires a dynamic string to be passed in, unless theres a better approach?

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

1 participant