mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-04-28 10:28:58 -05:00
fix: remove operation name
This commit is contained in:
21
lib/utils/request_serilizer.dart
Normal file
21
lib/utils/request_serilizer.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import "package:gql/execution.dart";
|
||||
import "package:gql/language.dart";
|
||||
import 'package:gql_link/gql_link.dart';
|
||||
|
||||
class GithubRequestSerializer extends RequestSerializer {
|
||||
const GithubRequestSerializer();
|
||||
|
||||
@override
|
||||
Map<String, dynamic> serializeRequest(Request request) {
|
||||
final RequestExtensionsThunk thunk = request.context.entry();
|
||||
|
||||
return <String, dynamic>{
|
||||
// Remove operationName here for GitHub API compatibility
|
||||
// "operationName": request.operation.operationName,
|
||||
"variables": request.operation.variables,
|
||||
"query": printNode(request.operation.document),
|
||||
if (thunk != null)
|
||||
"extensions": thunk.getRequestExtensions(request),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user