nhost-js
setRole()
Use nhost.setRole
to set the user role for all subsequent GraphQL, storage, and functions calls.
Underneath, this method sets the x-hasura-role
header on the graphql, storage,
and functions clients.
Note: Exercise caution when mixing the use of setRole
along with setHeaders
when setting the
x-hasura-role
header, as the last call will override any previous ones.
Parameters
role required string