Run a query on Github GraphQL. Args: query (str): The query to run. kwargs (dict): Any key-word arguments needed for the query. Returns: requests.models.Response
(self, query: str, **kwargs)
| 21 | self.base_url = 'https://api.github.com/graphql' |
| 22 | |
| 23 | def query(self, query: str, **kwargs): |
| 24 | """Run a query on Github GraphQL. |
| 25 | |
| 26 | Args: |
| 27 | query (str): |
| 28 | The query to run. |
| 29 | kwargs (dict): |
| 30 | Any key-word arguments needed for the query. |
| 31 | |
| 32 | Returns: |
| 33 | requests.models.Response |
| 34 | """ |
| 35 | response = requests.post( |
| 36 | self.base_url, json={'query': query, 'variables': kwargs}, headers=self.headers |
| 37 | ) |
| 38 | return response |
| 39 | |
| 40 | |
| 41 | class GithubClient(BaseClient): |
no test coverage detected