Masquerade (graphql_masquerade_schema)
Adds support for the masquerade module.
Schema
Base
graphql
type MasqueradeContext {
isMasquerading: Boolean!
}
Extension
graphql
extend type Query {
masqueradeContext: MasqueradeContext
}
extend type Mutation {
masqueradeSwitchBack: Boolean!
}
Examples
Determine if the current session is masquerading
graphql
query {
masqueradeContext {
isMasquerading
}
}
json
{
"data": {
"masqueradeContext": {
"isMasquerading": true
}
}
}
Switch back to the previous user
graphql
mutation {
masqueradeSwitchBack
}
json
{
"data": {
"masqueradeSwitchBack": true
}
}