@@ -117,6 +117,7 @@ await WriteErrorResponseAsync(httpResponse, writer, cancellationToken,
117
117
{
118
118
Query = urlGQLRequest . Query ?? bodyGQLRequest ? . Query ,
119
119
Inputs = urlGQLRequest . Inputs ?? bodyGQLRequest ? . Inputs ,
120
+ Extensions = urlGQLRequest . Extensions ?? bodyGQLRequest ? . Extensions ,
120
121
OperationName = urlGQLRequest . OperationName ?? bodyGQLRequest ? . OperationName
121
122
} ;
122
123
}
@@ -213,13 +214,15 @@ private Task WriteResponseAsync<TResult>(HttpResponse httpResponse, IDocumentWri
213
214
{
214
215
Query = queryCollection . TryGetValue ( GraphQLRequest . QUERY_KEY , out var queryValues ) ? queryValues [ 0 ] : null ,
215
216
Inputs = queryCollection . TryGetValue ( GraphQLRequest . VARIABLES_KEY , out var variablesValues ) ? _deserializer . DeserializeInputsFromJson ( variablesValues [ 0 ] ) : null ,
217
+ Extensions = queryCollection . TryGetValue ( GraphQLRequest . EXTENSIONS_KEY , out var extensionsValues ) ? _deserializer . DeserializeInputsFromJson ( extensionsValues [ 0 ] ) : null ,
216
218
OperationName = queryCollection . TryGetValue ( GraphQLRequest . OPERATION_NAME_KEY , out var operationNameValues ) ? operationNameValues [ 0 ] : null
217
219
} ;
218
220
219
221
private GraphQLRequest DeserializeFromFormBody ( IFormCollection formCollection ) => new GraphQLRequest
220
222
{
221
223
Query = formCollection . TryGetValue ( GraphQLRequest . QUERY_KEY , out var queryValues ) ? queryValues [ 0 ] : null ,
222
- Inputs = formCollection . TryGetValue ( GraphQLRequest . VARIABLES_KEY , out var variablesValue ) ? _deserializer . DeserializeInputsFromJson ( variablesValue [ 0 ] ) : null ,
224
+ Inputs = formCollection . TryGetValue ( GraphQLRequest . VARIABLES_KEY , out var variablesValues ) ? _deserializer . DeserializeInputsFromJson ( variablesValues [ 0 ] ) : null ,
225
+ Extensions = formCollection . TryGetValue ( GraphQLRequest . EXTENSIONS_KEY , out var extensionsValues ) ? _deserializer . DeserializeInputsFromJson ( extensionsValues [ 0 ] ) : null ,
223
226
OperationName = formCollection . TryGetValue ( GraphQLRequest . OPERATION_NAME_KEY , out var operationNameValues ) ? operationNameValues [ 0 ] : null
224
227
} ;
225
228
@@ -233,7 +236,7 @@ private async Task<GraphQLRequest> DeserializeFromGraphBodyAsync(Stream bodyStre
233
236
// work except for the disposing inner stream.
234
237
string query = await new StreamReader ( bodyStream ) . ReadToEndAsync ( ) ;
235
238
236
- return new GraphQLRequest { Query = query } ;
239
+ return new GraphQLRequest { Query = query } ; // application/graphql MediaType supports only query text
237
240
}
238
241
}
239
242
}
0 commit comments