const toJSON = data => {
        const type = getRequestType(data);
        const socketMessage = {type};

        if (type === 'query') {