File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -69,14 +69,19 @@ export class GrowingSchema {
6969 ) {
7070 const query = operation . query ;
7171
72- if ( ! this . seenQueries . has ( query ) ) {
73- this . seenQueries . add ( query ) ;
74- this . mergeQueryIntoSchema ( operation , response ) ;
75- }
76- // @todo handle variables
77- // const variables = operation.variables;
72+ const previousSchema = this . schema ;
73+
74+ try {
75+ if ( ! this . seenQueries . has ( query ) ) {
76+ this . seenQueries . add ( query ) ;
77+ this . mergeQueryIntoSchema ( operation , response ) ;
78+ }
7879
79- this . validateResponseAgainstSchema ( query , operation , response ) ;
80+ this . validateResponseAgainstSchema ( query , operation , response ) ;
81+ } catch ( e ) {
82+ this . schema = previousSchema ;
83+ throw e ;
84+ }
8085 }
8186
8287 public mergeQueryIntoSchema (
@@ -88,6 +93,8 @@ export class GrowingSchema {
8893 ) {
8994 const query = operation . query ;
9095
96+ // @todo handle variables
97+ // const variables = operation.variables;
9198 const typeInfo = new TypeInfo ( this . schema ) ;
9299 const responsePath = [ response . data ] ;
93100
You can’t perform that action at this time.
0 commit comments