UNPKG

@n1ru4l/graphql-live-query

Version:

[![npm version](https://img.shields.io/npm/v/@n1ru4l/graphql-live-query.svg)](https://www.npmjs.com/package/@n1ru4l/graphql-live-query) [![npm downloads](https://img.shields.io/npm/dm/@n1ru4l/graphql-live-query.svg)](https://www.npmjs.com/package/@n1ru4l/

17 lines (16 loc) 604 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLiveDirectiveNode = void 0; const Maybe_js_1 = require("./Maybe.js"); const getLiveDirectiveNode = (input) => { var _a; if (input.kind !== "OperationDefinition" || input.operation !== "query") { return null; } const liveDirective = (_a = input.directives) === null || _a === void 0 ? void 0 : _a.find((d) => d.name.value === "live"); if ((0, Maybe_js_1.isNone)(liveDirective)) { return null; } return liveDirective; }; exports.getLiveDirectiveNode = getLiveDirectiveNode;