Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
feat: example can handle multiple profile graphql queries
Browse files Browse the repository at this point in the history
  • Loading branch information
oed committed Dec 27, 2018
1 parent 79b4586 commit ada2aa4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,18 @@ profileGraphQL.addEventListener('click', () => {
Box.profileGraphQL(query).then(res => {
console.log(res)
profileGraphQLData.innerHTML = ''
Object.entries(res.profile).map(kv => {
profileGraphQLData.innerHTML +=kv[0] + ': ' + kv[1] + '<br />'
})
if (res.profile) {
Object.entries(res.profile).map(kv => {
profileGraphQLData.innerHTML +=kv[0] + ': ' + kv[1] + '<br />'
})
} else if (res.profiles) {
res.profiles.map(profile => {
Object.entries(profile).map(kv => {
profileGraphQLData.innerHTML +=kv[0] + ': ' + kv[1] + '<br />'
})
profileGraphQLData.innerHTML += '<hr />'
})
}
})
})

Expand Down

0 comments on commit ada2aa4

Please sign in to comment.