shopify_draft_proxy/shopify/resource_ids
Mirrors src/shopify/resource-ids.ts.
Two ordering helpers that several domain serializers reach for:
compare_shopify_resource_ids— sort GIDs (gid://shopify/X/123) numerically by the trailing integer when both ends parse, falling back to lexicographic compare.compare_nullable_strings— sort with explicitSome/Nonenullable handling:Nonesorts last, otherwise lexicographic.
Both return the conventional Lt/Eq/Gt instead of TS’s signed
integer; callers pair with list.sort directly.
Values
pub fn compare_nullable_strings(
left: option.Option(String),
right: option.Option(String),
) -> order.Order
Compare two Option(String) values: None sorts after Some(_);
two Some(_) values compare lexicographically.
pub fn compare_shopify_resource_ids(
left: String,
right: String,
) -> order.Order
Compare two Shopify GID strings. Tries to extract the trailing
integer (gid://shopify/Foo/123 → 123); when both sides parse,
compares numerically. Falls back to lexicographic compare.