@dillonkearns/elm-graphql
Version:
<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">
27 lines (16 loc) • 704 B
JavaScript
;
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var _this = undefined;
var isSubscription = function (definition) {
_newArrowCheck(this, _this);
return definition.kind === "OperationDefinition" && definition.operation === "subscription";
}.bind(undefined);
/**
* Returns true if documentNode has a subscription or false otherwise
*/
var hasSubscription = function (documentNode) {
_newArrowCheck(this, _this);
return documentNode.definitions.some(isSubscription);
}.bind(undefined);
module.exports = hasSubscription;