query and mutate promise on next

TTuxer11/20/2022
I've followed the guide "Usage with Next.js" and now I only have the useQuery and use useMutation hooks exposed when I want to call a route. How do I also expose the regular query and mutate promises on these routes?

Edit:
Solution:
const utils = trpc.useContext();

// use it (for example in an event handler)
const someResult = await utils.client.someRouter.someProcedure.query(/* args maybe */);
UUUnknown User11/21/2022
Message Not Public
Sign In & Join Server To View
TTuxer11/22/2022
First instantiating mutate from useMutation every time seems to be quite inconvenient.

I'm refering to this part of the docs https://trpc.io/docs/quickstart#querying--mutating. I'd like to call query and mutate like described:
const user = await trpc.userById.query('1');
const createdUser = await trpc.userCreate.mutate({ name: 'sachinraja' });
UUUnknown User11/22/2022
3 Messages Not Public
Sign In & Join Server To View
TTuxer11/22/2022
This looks very promising and exactly what I need. I'll try that.
TTuxer11/22/2022
In some cases I think it's more convenient to use the vanilla client instead of hooks, because hooks can not be used everywhere.
TTuxer11/22/2022
Okay, it worked as I needed it to. useContext must still be instantiated, direct access via the vanilla client would be even better, but it works via useContext(). Here is how to use it according to the docs:

const utils = trpc.useContext();

// use it (for example in an event handler)
const someResult = await utils.client.someRouter.someProcedure.query(/* args maybe */);
TTuxer11/22/2022
Thanks @julius and @cje