INNER CODE UNIT · Python
execute
psevensas/DjangoChannelsGraphqlWs · channels_graphql_ws/client.py:170
async def execute(self, query, variables=None):
"""Execute query or mutation request and wait for the reply.
Args:
query: A GraphQL query string. We `dedent` it, so you do not
have to.
variables: Dict of variables (optional).
Returns:
Dictionary with the GraphQL response.
"""
msg_id = await self.start(query, variables=variables)
try:
resp = await self.receive(wait_id=msg_id)
finally:
# Consume 'complete' message.
await self.receive(wait_id=msg_id)
return resp