I have two graphql queries first one is getUser and second one is getChatHistory. I want getChatHistory to execute only after getUser is executed and user details are fetched.
export const getChatHistory = gql`{
chatHistory {
title
}
}
`;
export const getUser = gql`{
user {
name
email
}
}
`;
const Home = ()=> {
const {loading: chatLoading,error:chatError,data:chatData}=useQuery(getChatHistory);
const {data:userData} = useQuery(getUser);
...