Problem Statement
How do you define endpoints in createApi and what options are available?
Explanation
Endpoints are defined in the endpoints callback function passed to createApi using a builder object that provides query and mutation methods for defining each endpoint type. Each endpoint requires a query function that specifies how to construct the request using url and optional method, body, headers, and params, plus configuration options like transformResponse to process data, providesTags for cache invalidation, and keepUnusedDataFor to control cache duration. You can also add onQueryStarted or onCacheEntryAdded for side effects, extraOptions for custom metadata, and merge or forceRefetch functions for advanced cache control.
