11"""Module containing graphQL client."""
22import json
33import logging
4- from typing import Callable
4+ from typing import Any , Callable
55
66import aiohttp
77import requests
1313class GraphqlClient :
1414 """Class which represents the interface to make graphQL requests through."""
1515
16- def __init__ (self , endpoint : str , headers : dict = {}, options : dict = {} ):
16+ def __init__ (self , endpoint : str , headers : dict = {}, ** kwargs : Any ):
1717 """Insantiate the client."""
1818 self .endpoint = endpoint
1919 self .headers = headers
20- self .options = options
20+ self .options = kwargs
2121
2222 def __request_body (
2323 self , query : str , variables : dict = None , operation_name : str = None
@@ -38,7 +38,7 @@ def execute(
3838 variables : dict = None ,
3939 operation_name : str = None ,
4040 headers : dict = {},
41- options : dict = {} ,
41+ ** kwargs : Any ,
4242 ):
4343 """Make synchronous request to graphQL server."""
4444 request_body = self .__request_body (
@@ -49,7 +49,7 @@ def execute(
4949 self .endpoint ,
5050 json = request_body ,
5151 headers = {** self .headers , ** headers },
52- ** {** self .options , ** options },
52+ ** {** self .options , ** kwargs },
5353 )
5454
5555 result .raise_for_status ()
0 commit comments