8000 Add variable support to GraphQL Endpoint (#498) · SnarkyPapi/server-client-python@234011b · GitHub
[go: up one dir, main page]

Skip to content

Commit 234011b

Browse files
authored
Add variable support to GraphQL Endpoint (tableau#498)
* Add variable support to GraphQL Endpoint * user public accessor
1 parent d87eaa2 commit 234011b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tableauserverclient/server/endpoint/metadata_endpoint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
class Metadata(Endpoint):
1010
@property
1111
def baseurl(self):
12-
return "{0}/api/exp/metadata/graphql".format(self.parent_s 8632 rv._server_address)
12+
return "{0}/api/metadata/graphql".format(self.parent_srv.server_address)
1313

1414
@api("3.2")
15-
def query(self, query, abort_on_error=False):
15+
def query(self, query, variables=None, abort_on_error=False):
1616
logger.info('Querying Metadata API')
1717
url = self.baseurl
1818

1919
try:
20-
graphql_query = json.dumps({'query': query})
20+
graphql_query = json.dumps({'query': query, 'variables': variables})
2121
except Exception:
2222
# Place holder for now
2323
raise Exception('Must provide a string')

0 commit comments

Comments
 (0)
0