@@ -299,7 +299,7 @@ export function makeGrafastSchema(details: GrafastSchemaConfig): GraphQLSchema {
299299 } else {
300300 // Hackily convert the new format into the old format. We'll do away with
301301 // this in future, but for now it's the easiest way to ensure compatibility
302- plans = { } ;
302+ plans = Object . create ( null ) ;
303303
304304 const assertLocation = <
305305 TExpected extends
@@ -357,7 +357,7 @@ export function makeGrafastSchema(details: GrafastSchemaConfig): GraphQLSchema {
357357 } ;
358358 for ( const [ typeName , spec ] of Object . entries ( objects ?? { } ) ) {
359359 const t = assertLocation ( typeName , "objects" ) ;
360- const o = { } as Record < string , any > ;
360+ const o = Object . create ( null ) as Record < string , any > ;
361361 plans [ typeName ] = o as any ;
362362
363363 const { plans : planResolvers = { } , ...rest } = spec ;
@@ -374,7 +374,7 @@ export function makeGrafastSchema(details: GrafastSchemaConfig): GraphQLSchema {
374374
375375 for ( const [ typeName , spec ] of Object . entries ( inputObjects ?? { } ) ) {
376376 const t = assertLocation ( typeName , "inputObjects" ) ;
377- const o = { } as Record < string , any > ;
377+ const o = Object . create ( null ) as Record < string , any > ;
378378 plans [ typeName ] = o as any ;
379379
380380 const { plans : planResolvers = { } , ...rest } = spec ;
@@ -393,7 +393,7 @@ export function makeGrafastSchema(details: GrafastSchemaConfig): GraphQLSchema {
393393
394394 for ( const [ typeName , spec ] of Object . entries ( unions ?? { } ) ) {
395395 assertLocation ( typeName , "unions" ) ;
396- const o = { } as Record < string , any > ;
396+ const o = Object . create ( null ) as Record < string , any > ;
397397 plans [ typeName ] = o as any ;
398398
399399 for ( const [ key , val ] of Object . entries ( spec ) ) {
@@ -403,7 +403,7 @@ export function makeGrafastSchema(details: GrafastSchemaConfig): GraphQLSchema {
403403
404404 for ( const [ typeName , spec ] of Object . entries ( interfaces ?? { } ) ) {
405405 assertLocation ( typeName , "interfaces" ) ;
406- const o = { } as Record < string , any > ;
406+ const o = Object . create ( null ) as Record < string , any > ;
407407 plans [ typeName ] = o as any ;
408408
409409 for ( const [ key , val ] of Object . entries ( spec ) ) {
@@ -418,7 +418,7 @@ export function makeGrafastSchema(details: GrafastSchemaConfig): GraphQLSchema {
418418
419419 for ( const [ typeName , spec ] of Object . entries ( enums ?? { } ) ) {
420420 const t = assertLocation ( typeName , "enums" ) ;
421- const o = { } as Record < string , any > ;
421+ const o = Object . create ( null ) as Record < string , any > ;
422422 plans [ typeName ] = o as any ;
423423
424424 const { values = { } , ...rest } = spec ;
0 commit comments