[Enhancement]: Provide $top
as a synonym for $first
in REST
#2474
Labels
enhancement
New feature or request
$top
as a synonym for $first
in REST
#2474
Proposal
Provide
$top
as a synonym for$first
in REST with no other behavioral change.Reasons for this minor change:
Alignment with data source syntax is only a coincidence. Intuitive use and OData alignment are the primary drivers.
TOP
SELECT TOP 5 Id, Name FROM Users
TOP
SELECT TOP 5 Id, Name FROM Users
LIMIT
SELECT Id, Name FROM Users LIMIT 5
LIMIT
SELECT Id, Name FROM Users LIMIT 5
Why is this proposal specific to REST?
In GraphQL,
first
is more common thantop
.first
is typically used in pagination, particularly with Relay-style connections. It specifies the number of items to retrieve starting from the current cursor.top
is not standard in GraphQL queries. If you encounter it, it’s likely specific to a custom schema.Current behavior
https://server/api/User?
$select=Id,Name
SELECT Id, Name
FROM User
&$first=10
SELECT TOP 10 Id, Name
FROM User
Proposed behavior
https://server/api/User?
$select=Id,Name
SELECT Id, Name
FROM User
&$first=10
SELECT TOP 10 Id, Name
FROM User
&$top=10
SELECT TOP 10 Id, Name
FROM User
// end
The text was updated successfully, but these errors were encountered: