Skip to content

Commit

Permalink
cylc#403 use alias when available for a field
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno P. Kinoshita committed Mar 15, 2020
1 parent f2a8c55 commit 366a2da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/gquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ function getSelections (a) {
const selections = {}
for (const selection of a.selectionSet.selections) {
if (selection.kind === 'Field') {
selections[selection.name.value] = selection
let key = selection.name.value
if (Object.hasOwnProperty.call(selection, 'alias') && selection.alias) {
key = selection.alias.value
}
selections[key] = selection
}
}
return selections
Expand Down

0 comments on commit 366a2da

Please sign in to comment.