Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 847 Bytes

ARC0015.md

File metadata and controls

26 lines (18 loc) · 847 Bytes
title ARC0015: Raw parameter converted to a concept
description Resolve ARC0015 in Arc TypeScript by binding query parameters as concepts rather than accepting raw values and converting them inside the query.

What

A @query method converts a primitive parameter with new Concept(parameter). Rule: arc-core/arc0015 (requires type information).

Why

The query pipeline validates the incoming declared parameter, not a concept constructed later in the method body. Command handle() parameters are services or provided values, not wire input. Review optional and search arguments before changing their type.

Bad

@query(argument('id', String))
static byId(id: string) { return tasks.byId(new TaskId(id)); }

Good

@query(argument('id', TaskId))
static byId(id: TaskId) { return tasks.byId(id); }