restwhich
Restwhich is a coined term describing a design pattern for RESTful APIs that lets clients specify, within a single request, which resources and fields should be included in the response. The concept combines ideas from sparse fieldsets, resource graphs, and query-like selectors to reduce over-fetch and tailor responses without adopting a full GraphQL interface.
Origin and scope: The term restwhich appears in API design discussions as a shorthand for choosing which
Usage and syntax: A request includes a which parameter that enumerates resources and fields. Example: GET /customers/42?which=profile(name,email),orders(id,total).
Implementation notes: Server-side logic builds a projection from the which clause, mapping to database queries or
Reception and comparison: Critics argue that restwhich can increase server-side complexity and reduce uniformity across APIs,