Пример #1
0
 async def negotiate(self):
     query_node = gql("""
             mutation Negotiate($internal: Boolean) {
                 negotiate(internal: $internal)
             }
         """)
     response = await self.async_transport.execute(
         query_node, variable_values=self.client.config.dict())
     return response.data["negotiate"]
Пример #2
0
    async def pass_async(self,
                         the_query: TypedGQL,
                         variables: dict = {},
                         **kwargs):
        query_node = gql(the_query.query)
        try:
            try:
                response = await self.async_transport.execute(
                    query_node, variable_values=variables)
            except Exception as e:
                console.print_exception(show_locals=True)
                raise TokenExpired(f"Token Expired {e}")

            if response.errors:
                raise GraphQLException(f"Ward {self._graphql_endpoint}:" +
                                       str(response.errors))

            return the_query.extract(response.data)

        except:
            console.print_exception(show_locals=True)
            raise
Пример #3
0
 def call(self, query: str, variables: Dict[str, Any]) -> str:
     return self.client.execute(gql(query), variable_values=variables)