@graphql-mesh/runtime
Version:
21 lines (20 loc) • 662 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStreamOperation = void 0;
const graphql_1 = require("graphql");
const utils_1 = require("@graphql-tools/utils");
exports.isStreamOperation = (0, utils_1.memoize1)(function isStreamOperation(astNode) {
let isStream = false;
(0, graphql_1.visit)(astNode, {
Field: {
enter(node) {
if (node.directives?.some(d => d.name.value === 'stream')) {
isStream = true;
return graphql_1.BREAK;
}
return undefined;
},
},
});
return isStream;
});
;