diff --git a/graphql_client/GraphQLHttpClient.py b/graphql_client/GraphQLHttpClient.py new file mode 100644 index 0000000..c7e2cf2 --- /dev/null +++ b/graphql_client/GraphQLHttpClient.py @@ -0,0 +1,14 @@ +import requests + +class GraphQLHttpClient: + + def __init__(self, url): + self.http_url = url + + def query(self, query, variables=None, headers=None): + payload = { 'headers': headers, 'query' : query, 'variables': variables } + resp = requests.post(self.http_url, json=payload) + return resp + + def mutation(self, query, variables=None, headers=None): + return self.query(query, variables, headers) \ No newline at end of file