supastarter for SvelteKitAPI
Mutate data with API
The previous example shows how to create a query, which means "getting data" from the API. If you want to perform a mutation (e.g. create, update, delete), you create a mutation endpoint instead.
This looks very similar to the query:
As with the query procedure, export the mutation procedure from your feature module's index.ts
:
Use the mutation
To use the mutation you can use the apiClient
again: