Rule of hooks error

Hello,
I'm discovering T3 Stack and I'm struggling with the react rule of hooks.

I would like to call this query :
const onPlaylistClick = () => {
    const { data: songsList } = api.spotify.songsList.useQuery(
      "3rsOyZnnXMBOiyBVVvpacn",
    );
    console.log(songsList);
  };

When I click on my button
Is there any way to call the query like a mutation ?
Thanks in advance !
Was this page helpful?