mirror of
https://github.com/git-touch/git-touch
synced 2024-12-24 06:42:07 +01:00
22 lines
699 B
Dart
22 lines
699 B
Dart
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),
|
|
};
|
|
}
|
|
}
|