Our great sponsors
- CodiumAI - TestGPT | Generating meaningful tests for busy devs
- ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
- InfluxDB - Access the most powerful time series database as a service
- SonarLint - Clean code begins in your IDE with SonarLint
-
flexible-presenter
Easily define just the right data for your InertiaJS views (or anywhere else you want to, uh, flexibly present).
I don’t know enough about writing APIs to tell you if this would work, but we use https://github.com/AdditionApps/flexible-presenter very successfully. It has ‘preset’s which are subsets of the available fields - so where I’m displaying just user name and need their id for routing i can call the presenter with ->preset(‘listing’) to only get those fields.
-
Cool, if you do go with graphql, I'd recommend vue-apollo on the client end. Combine with @vue/apollo-composable and graphql-codegen and it feels like sorcery.
-
CodiumAI
TestGPT | Generating meaningful tests for busy devs. Get non-trivial tests (and trivial, too!) suggested right inside your IDE, so you can code smart, create more value, and stay confident when you push.
-
You can either do the "per-view" style you mentioned, or you can let the client tell the API what it wants. I'd check out the JSON:API spec for inspiration.