/** * Disclaimer: Just because JSON:API supports robust querying doesn’t mean your service should * implement them as they may require database indexes, which have a cost. **Implement only access * patterns required by clients.** * * The spec says that if clients provide fields the server doesn’t support, it **MUST** return 400 * Bad Request, hence the `.strict()`. */ exportconstquery = z .object({ ...cursorPaginationQuery(), ...fieldsQuery({ article:articleFields, user:userFields }), ...filterQuery(userFilterMap), ...sortQuery(userFields), ...includeQuery(userIncludeFields), }) .strict();
Creates a Zod schema for JSON:API sort parameters.