UNPKG

521 BJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * strict-local
8 * @format
9 */
10'use strict';
11
12function hasUnaliasedSelection(field, fieldName) {
13 return field.selections.some(function (selection) {
14 return selection.kind === 'ScalarField' && selection.alias == null && selection.name === fieldName;
15 });
16}
17
18module.exports = {
19 hasUnaliasedSelection: hasUnaliasedSelection
20};
\No newline at end of file