Skip to content
代码片段 群组 项目
提交 c4ec91bc 编辑于 作者: Matthias Kaeppler's avatar Matthias Kaeppler
浏览文件

Fix missing caller_id for GraphQL subscriptions

Changelog: fixed
上级 fbbaa9c6
No related branches found
No related tags found
无相关合并请求
...@@ -4,7 +4,9 @@ const yaml = require('js-yaml'); ...@@ -4,7 +4,9 @@ const yaml = require('js-yaml');
const { evaluateModuleFromSource } = require('../helpers/evaluate_module_from_source'); const { evaluateModuleFromSource } = require('../helpers/evaluate_module_from_source');
const PLUGIN_NAME = 'GraphqlKnownOperationsPlugin'; const PLUGIN_NAME = 'GraphqlKnownOperationsPlugin';
const GRAPHQL_PATH_REGEX = /(query|mutation)\.graphql$/; const SUPPORTED_OPS = ['query', 'mutation', 'subscription'];
/* eslint-disable no-useless-escape */
const GRAPHQL_PATH_REGEX = new RegExp(`(${SUPPORTED_OPS.join('|')})\.graphql$`);
/** /**
* Returns whether a given webpack module is a "graphql" module * Returns whether a given webpack module is a "graphql" module
...@@ -34,7 +36,7 @@ const getOperationNames = (module) => { ...@@ -34,7 +36,7 @@ const getOperationNames = (module) => {
}); });
const names = moduleExports.definitions const names = moduleExports.definitions
.filter((x) => ['query', 'mutation'].includes(x.operation)) .filter((x) => SUPPORTED_OPS.includes(x.operation))
.map((x) => x.name?.value) .map((x) => x.name?.value)
// why: It's possible for operations to not have a name. That violates our eslint rule, but either way, let's ignore those here. // why: It's possible for operations to not have a name. That violates our eslint rule, but either way, let's ignore those here.
.filter(Boolean); .filter(Boolean);
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册