File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -138,19 +138,18 @@ self = module.exports = {
138138 case 'raw' :
139139 snippet += indent + `--data-raw ${ quoteType } ${ sanitize ( body . raw . toString ( ) , trim , quoteType ) } ${ quoteType } ` ;
140140 break ;
141- // eslint-disable-next-line no-case-declarations
142- case 'graphql' :
141+ case 'graphql' :
143142 // eslint-disable-next-line no-case-declarations
144143 let query = body . graphql ? body . graphql . query : '' ,
145- graphqlVariables = body . graphql ? body . graphql . variables : '{}' ;
144+ graphqlVariables ;
146145 try {
147- graphqlVariables = JSON . parse ( graphqlVariables || '{}' ) ;
146+ graphqlVariables = JSON . parse ( body . graphql . variables ) ;
148147 }
149148 catch ( e ) {
150149 graphqlVariables = { } ;
151150 }
152151 snippet += indent + `--data-raw ${ quoteType } ${ sanitize ( JSON . stringify ( {
153- query : query || '' ,
152+ query : query ,
154153 variables : graphqlVariables
155154 } ) , trim , quoteType ) } ${ quoteType } `;
156155 break ;
You can’t perform that action at this time.
0 commit comments