"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformOperation = transformOperation;
const utilities_1 = require("@apollo/client/utilities");
function transformOperation(operation) {
    const transformedOperation = {
        variables: operation.variables || {},
        extensions: operation.extensions || {},
        operationName: operation.operationName,
        query: operation.query,
    };
    // Best guess at an operation name
    if (!transformedOperation.operationName) {
        transformedOperation.operationName =
            typeof transformedOperation.query !== "string" ?
                (0, utilities_1.getOperationName)(transformedOperation.query) || undefined
                : "";
    }
    return transformedOperation;
}
//# sourceMappingURL=transformOperation.cjs.map
