@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">
23 lines (14 loc) • 551 B
JavaScript
import _newArrowCheck from '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);
export default hasSubscription;