@@ -259,15 +259,20 @@ public class GraphQlController :
259259 return Execute (query , operationName , inputs , cancellation );
260260 }
261261
262+ public class GraphQLQuery
263+ {
264+ public string ? OperationName { get ; set ; }
265+ public string Query { get ; set ; }= null ! ;
266+ public string ? Variables { get ; set ; }
267+ }
268+
262269 [HttpPost ]
263270 public Task Post (
264- [FromQuery ] string query ,
265- [FromQuery ] string ? variables ,
266- [FromQuery ] string ? operationName ,
271+ [FromBody ]GraphQLQuery query ,
267272 CancellationToken cancellation )
268273 {
269- var inputs = variables .ToInputs ();
270- return Execute (query , operationName , inputs , cancellation );
274+ var inputs = query . Variables .ToInputs ();
275+ return Execute (query . Query , query . OperationName , inputs , cancellation );
271276 }
272277
273278 async Task Execute (string query ,
@@ -293,7 +298,7 @@ public class GraphQlController :
293298 }
294299}
295300```
296- <sup ><a href =' /src/SampleWeb/GraphQlController.cs#L6-L66 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-graphqlcontroller ' title =' Start of snippet ' >anchor</a ></sup >
301+ <sup ><a href =' /src/SampleWeb/GraphQlController.cs#L6-L71 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-graphqlcontroller ' title =' Start of snippet ' >anchor</a ></sup >
297302<!-- endSnippet -->
298303
299304
0 commit comments