Tableau Metadata API - How graphiql has simplified data discovery
Updated: Sep 26, 2021
Quick Intro on GraphQL and Metadata API
At the flag end of 2019( tableau 2019.3 or later) tableau metadata api was released. The Tableau Metadata API discovers and indexes all of the content on your Tableau Online site or Tableau Server. This api allows you to discover data, track lineage and perform impact analysis. The Metadata API uses GraphQL, a query language for APIs that describes how to ask for and return only the data that you’re interested in. Tableau provides a user interface called "GraphiQL" which is not enabled by default in Tableau server and is free. However if you need full capabilities of data lineage you need to buy Tableau data catalog ( part of data management add-on's)
How is it different from REST api?
Like REST APIs, GraphQL is also served over HTTP. However, instead of sending requests to multiple endpoints, you can make one query to one endpoint and have that filtered to return only what you ask for. This saves round-trips.
Can I not use Postgresql?
Yes, Postgresql can give you same insights however it involves writing lot of complex joins, whereas Graphql gives you insights on the fly - you get what you see.
Is it Free? and how can I use it?
It is free if you have tableau server license , however you need to be a server admin or site admin and must enable the Metadata API on Tableau Server using the TSM command. Run the command - "tsm maintenance metadata-services enable". After this access the Graphiql UI by using the URL https://XXX/metadata/graphiql note: In Tableau Online metadata api is enabled by default.
What is my experience?
I have been using this from the last 3 months and my experience is great!! Instead of me writing complex queries in postgresql , I can write simple json queries to get what I see and that too without me having to prepare anything!!. In the below example I wanted to analyze workbooks stats tied to a particular published datasource. I get my json results in seconds which is then consumed by my tableau dashboard for further analysis.. You could automate this behavior using python ( via api) - there is lot of documentation on the web on this so I wont go over this route.
You compare and contrast this with postgresql queries ( see below - although they are not same just look at the joins and keys to get right result )
Understanding how data moves and capturing this info is critical for any company. Using metadata api's you automate data governance insights and ensure your data is protected and governed. GraphiQL empowers your tableau power users to track and see the impact of data changes and also automate certain tableau metadata insights on the fly.
* More info on graphql and example scripts are below:-
Love to hear your comments...Happy blogging!!