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/

11 lines (10 loc) 549 B
import { getDirectiveValues } from "graphql"; import { GraphQLLiveDirective } from "./GraphQLLiveDirective.js"; export const getLiveDirectiveArgumentValues = (node, variableValues) => { var _a; const values = getDirectiveValues(GraphQLLiveDirective, { directives: [node] }, variableValues); return { isLive: (values === null || values === void 0 ? void 0 : values["if"]) === true, throttleValue: ((_a = values === null || values === void 0 ? void 0 : values["throttle"]) !== null && _a !== void 0 ? _a : null), }; };