Using Studio is it possible for the Select dropdown’s onChange to run a new graphql query? The query actually needs a graphql argument, which I’d like to be the Option’s value. Example use case: I have a Select populated with a list of US states. Each time a different state is chosen, a list of several major cities in that state should be displayed as text.
Hey Vahid! Yes, it’s possible. You need to bind the select value variable with the graphql query prop. So, whenever the value variable is updated, a new query will be made using the new value.
Project example: https://studio.plasmic.app/projects/8g6vr3D11SS8wHWi7gGp8p/branch/main@latest/page/Homepage
Wow, nice! That is a ninja way to use dynamic variables on the query prop.
Another thing you could do is to set just the variable overrides prop to a dynamic value that references the state of the select, and make use of the variables within the graphql query builder. This might be slightly easier since you can continue offering your graphql query and the full query builder UI. But both approaches work!