File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,10 @@ export function createGraphQLError(message: string, options?: GraphQLErrorOption
8888 ) ;
8989
9090 if ( options ?. coordinate && error . coordinate == null ) {
91- Object . defineProperty ( error , 'coordinate' , {
92- value : options . coordinate ,
93- enumerable : true ,
94- configurable : true ,
91+ Object . defineProperties ( error , {
92+ coordinate : { value : options . coordinate , enumerable : true , configurable : true } ,
93+ toJSON : { value : toJSON } ,
9594 } ) ;
96- error . toJSON = toJSON ;
9795 }
9896
9997 return error ;
@@ -115,10 +113,10 @@ export function locatedError(
115113
116114 // `graphql` locatedError is only changing path and nodes if it is not already defined
117115 if ( ! error . coordinate && info && error . coordinate == null ) {
118- Object . defineProperty ( error , ' coordinate' , {
119- value : ` ${ info . parentType . name } . ${ info . fieldName } ` ,
120- enumerable : true ,
121- configurable : true ,
116+ const coordinate = ` ${ info . parentType . name } . ${ info . fieldName } ` ;
117+ Object . defineProperties ( error , {
118+ coordinate : { value : coordinate , enumerable : true , configurable : true } ,
119+ toJSON : { value : toJSON } ,
122120 } ) ;
123121 }
124122
You can’t perform that action at this time.
0 commit comments