From 14d63e8b8bdde3aad9c32fdde9196c4a65675781 Mon Sep 17 00:00:00 2001 From: Tyler Doyle Date: Wed, 11 Sep 2019 12:53:05 -0700 Subject: [PATCH 1/2] Add variable support to GraphQL Endpoint --- tableauserverclient/server/endpoint/metadata_endpoint.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tableauserverclient/server/endpoint/metadata_endpoint.py b/tableauserverclient/server/endpoint/metadata_endpoint.py index 82f91844c..e730bc363 100644 --- a/tableauserverclient/server/endpoint/metadata_endpoint.py +++ b/tableauserverclient/server/endpoint/metadata_endpoint.py @@ -9,15 +9,15 @@ class Metadata(Endpoint): @property def baseurl(self): - return "{0}/api/exp/metadata/graphql".format(self.parent_srv._server_address) + return "{0}/api/metadata/graphql".format(self.parent_srv._server_address) @api("3.2") - def query(self, query, abort_on_error=False): + def query(self, query, variables=None, abort_on_error=False): logger.info('Querying Metadata API') url = self.baseurl try: - graphql_query = json.dumps({'query': query}) + graphql_query = json.dumps({'query': query, 'variables': variables}) except Exception: # Place holder for now raise Exception('Must provide a string') From 13e8a2329935ac9b7fc41b586c98de073d057e56 Mon Sep 17 00:00:00 2001 From: Tyler Doyle Date: Wed, 11 Sep 2019 13:00:46 -0700 Subject: [PATCH 2/2] user public accessor --- tableauserverclient/server/endpoint/metadata_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tableauserverclient/server/endpoint/metadata_endpoint.py b/tableauserverclient/server/endpoint/metadata_endpoint.py index e730bc363..002379407 100644 --- a/tableauserverclient/server/endpoint/metadata_endpoint.py +++ b/tableauserverclient/server/endpoint/metadata_endpoint.py @@ -9,7 +9,7 @@ class Metadata(Endpoint): @property def baseurl(self): - return "{0}/api/metadata/graphql".format(self.parent_srv._server_address) + return "{0}/api/metadata/graphql".format(self.parent_srv.server_address) @api("3.2") def query(self, query, variables=None, abort_on_error=False):