graphql-zeus
graphql-zeus copied to clipboard
best way to use refetchQueries
Here's how I've gotten this to work with React, but I'm hoping there's a better way other than the [gql(Zeus.query(q_get_profile))] call below:
const { loading, error, data } = useTypedQuery(q_get_profile)
const [mutation] = useTypedMutation(
{
update_profiles_by_pk: [
{
pk_columns: { id: $`profileId` },
_set: $`_set`,
},
{
id: true
}
]
},
{
refetchQueries: [gql(Zeus.query(q_get_profile))],
}
)
Thanks! David