Skip to content

Commit 26518de

Browse files
Fix for code scanning alert no. 45: Incomplete string escaping or encoding (#7025)
* Potential fix for code scanning alert no. 45: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Changeset --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 784c2be commit 26518de

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/whole-hands-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-tools/utils': patch
3+
---
4+
5+
Better handling for field name handling in `buildOperationForField`

packages/utils/src/build-operation-for-field.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,9 @@ function resolveField({
479479
if (fieldTypeMap.has(fieldPathStr) && fieldTypeMap.get(fieldPathStr) !== field.type.toString()) {
480480
fieldName += (field.type as any)
481481
.toString()
482-
.replace('!', 'NonNull')
483-
.replace('[', 'List')
484-
.replace(']', '');
482+
.replace(/!/g, 'NonNull')
483+
.replace(/\[/g, 'List')
484+
.replace(/\]/g, '');
485485
}
486486
fieldTypeMap.set(fieldPathStr, field.type.toString());
487487

0 commit comments

Comments
 (0)