import { getOperationName } from "@apollo/client/utilities/internal";
export 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" ?
                getOperationName(transformedOperation.query)
                : "";
    }
    return transformedOperation;
}
//# sourceMappingURL=transformOperation.js.map
