I want to fetch data from GraphQl api in directly to Power Bi how I can That
1 Answer
If the auth for the API is API Key, Basic, Windows, or AAD, you can use the Web connector. For other Authentication scenarios you may need a custom connector.
And I would use the Advanced Power Query Editor for this, rather than trying to configure it through the Wizard.
EG
let
uri = "https://countries.trevorblades.com",
query = "{
country(code: ""BR"") {
name
native
capital
emoji
currency
languages {
code
name
}
}
}",
source = uri & "?query=" & Uri.EscapeDataString(query),
resp = Web.Contents(source),
json = Json.Document(resp,65001),
data = json[data],
country = data[country],
#"Converted to Table" = Record.ToTable(country),
#"Pivoted Column" = Table.Pivot(#"Converted to Table", List.Distinct(#"Converted to Table"[Name]), "Name", "Value")
in
#"Pivoted Column"