sdy

update useQuery object destructuring

......@@ -17,14 +17,17 @@ export default withRouter(({ location }) => {
let messageObj, outcomingMsg, roomId;
if (roomName !== undefined) {
const { data } = useQuery(GET_ROOM_BY_NAME, { variables: { roomName } });
const {
data: { getRoomByName },
} = useQuery(GET_ROOM_BY_NAME, { variables: { roomName } });
roomId = getRoomByName.id;
getRoomByName: {
getRoomByName: { id: roomId },
},
} = data;
console.log(roomId);
}
const [createMsg] = useMutation(WHOLE_MESSAGE);
const { data } = useSubscription(SUBSCRIPTION_MSG);
//const { data } = useSubscription(SUBSCRIPTION_MSG);
const message = useInput("");
......