What problem does this solve?
Services repeatedly check mutation payload success and entity presence manually. The pattern is correct but duplicated across many services, increasing the chance of inconsistent null handling or error messages.
Proposed solution
Create small helper functions for common Linear mutation payload patterns.
Example direction:
export function requireMutationEntity<TEntity>(
payload: { success: boolean; entity?: TEntity | null },
message: string,
): TEntity {
if (!payload.success || !payload.entity) throw new Error(message);
return payload.entity;
}
Additional helpers may be needed for payload fields like issue, project, comment, etc.
Acceptance criteria:
- Shared helper exists for mutation payload extraction.
- At least issue/project/initiative services use it.
- Error behavior remains stable unless intentionally changed.
Alternatives considered
Keep local checks in every service. This is explicit but repetitive.
Primary use case
LLM agent integration
What problem does this solve?
Services repeatedly check mutation payload success and entity presence manually. The pattern is correct but duplicated across many services, increasing the chance of inconsistent null handling or error messages.
Proposed solution
Create small helper functions for common Linear mutation payload patterns.
Example direction:
Additional helpers may be needed for payload fields like issue, project, comment, etc.
Acceptance criteria:
Alternatives considered
Keep local checks in every service. This is explicit but repetitive.
Primary use case
LLM agent integration