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

How to pass context variables to gatsby plugin local search query? #33

Open
miguelt1 opened this issue Mar 15, 2021 · 1 comment
Open

Comments

@miguelt1
Copy link

miguelt1 commented Mar 15, 2021

In query I would like to have a dynamic variable to filter, that variable would be like a context variable, is that possible?

@angeloashmore
Copy link
Owner

Hi @miguelt1, could you share more about your setup? Since the query is called just once during Gatsby's bootstrapping phase, we aren't looping over content where variables normally would be used.

What kind of variables would you want to use?

For now, you can interpolate values into your query option since it is just a string. Any data available in your gatsby-node.js (which means anything you can do in Node.js, like reading a file or loading environment variables), can be added to your query via string interpolation.

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