@n1ru4l/graphql-live-query
Version:
[](https://www.npmjs.com/package/@n1ru4l/graphql-live-query) [](https://www.npmjs.com/package/@n1ru4l/
11 lines (10 loc) • 549 B
JavaScript
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),
};
};