Directives

Meta: short page. The interesting bit is that Dang directives are real declarations, type-checked, not magic comments — that's the differentiator from most languages with comment-pragmas.

What a directive is

directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | OBJECT
directive @experimental on FIELD_DEFINITION | ARGUMENT_DEFINITION
directive @auth(role: String!) on FIELD_DEFINITION
directive @cache(ttl: Int! = 300, key: String) on FIELD_DEFINITION

Locations (on ...)

Applying

type Person @deprecated(reason: "use NewPerson") {
  pub name: String! @deprecated
  pub email: String! @cache(ttl: 60)
}
@check
pub mixedField: String! @cache(ttl: 120) { "mixed" }

Arguments

Qualified access

Common built-ins

Structural, not semantic

Meta: this framing is the differentiator — call it out.