Problem Statement
What naming convention does RTK Query use for auto-generated hooks?
Explanation
RTK Query automatically generates React hooks following the pattern use[EndpointName]Query for query endpoints and use[EndpointName]Mutation for mutation endpoints, where EndpointName matches the key you defined in your endpoints object. For example, an endpoint named getPosts generates useGetPostsQuery, and createPost generates useCreatePostMutation. These hooks handle loading states, errors, data, and refetching automatically, making data fetching extremely simple in components.
