File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,16 @@ export function GraphQLError( // eslint-disable-line no-redeclare
77
77
path ?: ?Array < string | number > ,
78
78
originalError ?: ?Error
79
79
) {
80
+ // Define message so it can be captured in stack trace.
81
+ Object . defineProperty ( this , 'message' , {
82
+ value : message ,
83
+ // By being enumerable, JSON.stringify will include `message` in the
84
+ // resulting output. This ensures that the simplist possible GraphQL
85
+ // service adheres to the spec.
86
+ enumerable : true ,
87
+ writable : true
88
+ } ) ;
89
+
80
90
// Include (non-enumerable) stack trace.
81
91
if ( originalError && originalError . stack ) {
82
92
Object . defineProperty ( this , 'stack' , {
@@ -117,14 +127,6 @@ export function GraphQLError( // eslint-disable-line no-redeclare
117
127
}
118
128
119
129
Object . defineProperties ( this , {
120
- message : {
121
- value : message ,
122
- // By being enumerable, JSON.stringify will include `message` in the
123
- // resulting output. This ensures that the simplist possible GraphQL
124
- // service adheres to the spec.
125
- enumerable : true ,
126
- writable : true
127
- } ,
128
130
locations : {
129
131
// Coercing falsey values to undefined ensures they will not be included
130
132
// in JSON.stringify() when not provided.
You can’t perform that action at this time.
0 commit comments