File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
graphene_django/static/graphene_django Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 135135 // Run a regex against the query to determine the operation type (query, mutation, subscription).
136136 var operationRegex = new RegExp (
137137 // Look for lines that start with an operation keyword, ignoring whitespace.
138- "^\\s*(query|mutation|subscription)\\s+ " +
139- // The operation keyword should be followed by the operationName in the GraphQL parameters.
140- graphQLParams . operationName +
138+ "^\\s*(query|mutation|subscription)\\s* " +
139+ // The operation keyword should be followed by whitespace and the operationName in the GraphQL parameters (if available) .
140+ ( graphQLParams . operationName ? ( "\\s+" + graphQLParams . operationName ) : "" ) +
141141 // The line should eventually encounter an opening curly brace.
142142 "[^\\{]*\\{" ,
143143 // Enable multiline matching.
144144 "m" ,
145145 ) ;
146146 var match = operationRegex . exec ( graphQLParams . query ) ;
147+ if ( ! match ) {
148+ return "query" ;
149+ }
147150
148151 return match [ 1 ] ;
149152 }
You can’t perform that action at this time.
0 commit comments