UNPKG

@apollo/client

Version:

A fully-featured caching GraphQL client.

18 lines 595 B
import { InvariantError } from "../../utilities/globals/index.js"; export function validateOperation(operation) { var OPERATION_FIELDS = [ 'query', 'operationName', 'variables', 'extensions', 'context', ]; for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { var key = _a[_i]; if (OPERATION_FIELDS.indexOf(key) < 0) { throw __DEV__ ? new InvariantError("illegal argument: ".concat(key)) : new InvariantError(27); } } return operation; } //# sourceMappingURL=validateOperation.js.map