File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed
Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @graphql-tools/mock ' : patch
3+ ---
4+
5+ Prevent prototype polluting assignment
Original file line number Diff line number Diff line change 1+ ---
2+ ' @graphql-tools/utils ' : patch
3+ ---
4+
5+ Better handling for field name handling in ` buildOperationForField `
Original file line number Diff line number Diff line change @@ -266,9 +266,11 @@ export class MockStore implements IMockStore {
266266 if ( typeName === '__proto__' || typeName === 'constructor' || typeName === 'prototype' ) {
267267 throw new Error ( `Invalid typeName: ${ typeName } ` ) ;
268268 }
269+
269270 if ( key === '__proto__' || key === 'constructor' || key === 'prototype' ) {
270271 throw new Error ( `Invalid key: ${ key } ` ) ;
271272 }
273+
272274 if ( this . store [ typeName ] === undefined ) {
273275 this . store [ typeName ] = { } ;
274276 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments