File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,13 @@ export interface ErrorConfig {
1616
1717export interface ErrorInfo {
1818 message : string ;
19- name : string ;
20- time_thrown : string ;
21- data ?: object ;
2219 path ?: string ;
2320 locations ?: any ;
21+ extensions ?: {
22+ name : string ;
23+ time_thrown : string ;
24+ data ?: object ;
25+ } ;
2426}
2527
2628export class ApolloError extends ExtendableError {
@@ -59,11 +61,13 @@ export class ApolloError extends ExtendableError {
5961
6062 let error : ErrorInfo = {
6163 message,
62- name,
63- time_thrown,
64- data,
6564 path,
66- locations
65+ locations,
66+ extensions : {
67+ name,
68+ time_thrown,
69+ data
70+ }
6771 } ;
6872
6973 if ( _showLocations ) {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ describe('createError', () => {
3131 } ,
3232 } ) ;
3333
34- const { message, name, time_thrown, data } = e . serialize ( ) ;
34+ const { message, extensions : { name, time_thrown, data } } = e . serialize ( ) ;
3535 expect ( message ) . to . equal ( 'A foo 2.0 error has occurred' ) ;
3636 expect ( name ) . to . equal ( 'FooError' ) ;
3737 expect ( time_thrown ) . to . equal ( e . time_thrown ) ;
You can’t perform that action at this time.
0 commit comments