Closed dxlbnl closed 2 years ago
Hey @neoel! Sorry for not replying sooner, I'm trying to think of the right way to support this. Do you have any recommendations for the api?
Possibly a context object to be passed to query and mutation:
const { data } = query(graphl``, {
contextParam: 'value'
})
Inside environment we could get this context param and apply it wherever necessary.
It would be like metadata
that users can send per query?
Like this, users will make use of it in their own fetchQuery
?
@jycouet since we mention this as a good usecase for the store API, we should make sure its actually possible 😅 Thoughts on including this in 0.15.0?
Yeah, seems reasonable to add it. Just, let's NOT name it context (we already have 42 😅)
I can have a look. We go with metadata
?
It's in https://github.com/HoudiniGraphql/houdini/pull/344 🥳
I will let you close @AlecAivazis when it's deployed? (even under a -next-xx
version)
🎉 It's now been published as part of 0.15.0-next.13
I'm using hasura which requires some information to be passed to the header for some specific queries. Now it's possible to write to the session in an onmount, and cleaning the session onDestroy, its not so clean and the whole session needs updating.
I'd like a query to be able to pass some data to a query where I could set it to the right place with the environment call