1 | import { newInvariantError } from "../../utilities/globals/index.js";
|
2 | export function validateOperation(operation) {
|
3 | var OPERATION_FIELDS = [
|
4 | "query",
|
5 | "operationName",
|
6 | "variables",
|
7 | "extensions",
|
8 | "context",
|
9 | ];
|
10 | for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
|
11 | var key = _a[_i];
|
12 | if (OPERATION_FIELDS.indexOf(key) < 0) {
|
13 | throw newInvariantError(44, key);
|
14 | }
|
15 | }
|
16 | return operation;
|
17 | }
|
18 | //# sourceMappingURL=validateOperation.js.map |
\ | No newline at end of file |