Though variables aren't required, you should use them whenever you have mutable argument values.


useVariable follows the same format as React.useState. Once created, you can pass the variable to an argument:

import { graphql, useVariable } from '@gqless/react'
const Component = graphql(() => {
const [id, setId] = useVariable('bob')
return <div>{query.user({ id }).name}</div>
Last updated on by George Karagkiaouris