Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/plugins/graphql/gqlHttpRegionParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function getGQLContent(lineReader: models.HttpLineGenerator): Promise<GqlP
if (!next.done) {
const startLine = next.value.line;

const fileMatches = /^\s*gql(\s+(?<name>[^\s(]+))?\s+<\s+(?<fileName>.+)\s*$/u.exec(next.value.textLine);
const fileMatches = /^\s*gql(\s+(?<name>[^\s({]+))?\s+<\s+(?<fileName>.+)\s*$/u.exec(next.value.textLine);
if (fileMatches && fileMatches.groups?.fileName) {
const parserPath = fileMatches.groups.fileName.trim();
return {
Expand Down Expand Up @@ -95,11 +95,11 @@ async function getGQLContent(lineReader: models.HttpLineGenerator): Promise<GqlP
utils.replaceFilePath(parserPath, context, (path: models.PathLike) => fileProvider.readFile(path, 'utf-8')),
};
}
const queryMatch = /^\s*(query|mutation)(\s+(?<name>[^\s(]+))?/u.exec(next.value.textLine);
const queryMatch = /^\s*(query|mutation)(\s+(?<name>[^\s({]+))?/u.exec(next.value.textLine);
if (queryMatch) {
return matchGqlContent(next.value, lineReader, queryMatch.groups?.name);
}
const fragmentMatch = /^\s*(fragment)\s+(?<name>[^\s(]+)\s+on\s+/u.exec(next.value.textLine);
const fragmentMatch = /^\s*(fragment)\s+(?<name>[^\s({]+)\s+on\s+/u.exec(next.value.textLine);
if (fragmentMatch) {
return matchGqlContent(next.value, lineReader, fragmentMatch.groups?.name);
}
Expand Down