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/

21 lines (20 loc) 859 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GraphQLLiveDirective = void 0; const graphql_1 = require("graphql"); exports.GraphQLLiveDirective = new graphql_1.GraphQLDirective({ name: "live", description: "Instruction for establishing a live connection that is updated once the underlying data changes.", locations: [graphql_1.DirectiveLocation.QUERY], args: { if: { type: graphql_1.GraphQLBoolean, defaultValue: true, description: "Whether the query should be live or not.", }, throttle: { type: graphql_1.GraphQLInt, description: 'Propose a desired throttle interval ot the server in order to receive updates to at most once per "throttle" milliseconds. The server must not accept this value.', }, }, });