Cliff
Cliff
TtRPC
Created by Cliff on 6/4/2024 in #❓-help
integrating with Meteor
I have made a simple app with express before and now I am trying to get a proof of concept running with Meteor.js. Meteor has a webApp component that behaves much like an express handler. For example, I can do this:
WebApp.connectHandlers.use('/trpc',

(req, res, next) => {
// request logger
console.log(':arrow_left: ', req.method, req.path, req.body ?? req.query);

next();
}
);
WebApp.connectHandlers.use('/trpc',

(req, res, next) => {
// request logger
console.log(':arrow_left: ', req.method, req.path, req.body ?? req.query);

next();
}
);
I was able to create api routers the same as in all the sample docs, but without an actual meteor middleware, I am not sure what to put in the handler above to connect it all up. Any advice?
3 replies
TtRPC
Created by Cliff on 1/17/2024 in #❓-help
Help with queries vs mutations
super basic question here from a newb to trpc...i see the calls are basically split into two type, queries and mutations. If I were to build a simple chat app, would posting a comment be a mutation? What if the data was ephemeral, like, I wasn't storing it, just passing it. Or if I was sending a parameter to the server and the server just used that parameter to look upo data from a third party service and return the results...that is still just a query, right? Even if the client was storing a 'history' of requests?
2 replies