if im understanding this correctly, if im on the server i can use the local API
https://payloadcms.com/docs/getting-started/concepts#local-api
but if im on the client my hands are tied a bit (i mean for type saftey), my options are
- use the rest api directly (i will lose all the type saftey, unless i make my own wrappers using tanstack query or use somethning like ts-rest, or zodios)
- make a trpc server and use local-api and make my own wrappers again
- use graphql with apollo to make it generate the hooks for me.
- idk, is there is an sdk or something like that i remmber seeing an issue or a pull request on github if im not mistaken
so the question is what is the best way to access the data from client components, like if a user clicked the like button how can i make the mutation and invalidate the likes etc