# Flag deprecation

When a flag is no longer needed, you can mark it as deprecated in your [schema](/concepts/schema.md) from the Hypertune UI or in GraphQL with the `@deprecated` directive:

```graphql
type Root {
  showNewEditor: Boolean! @deprecated(reason: "New editor has shipped.")
}
```

A deprecated flag will still evaluate correctly, but when you regenerate your client, it won't be included so you'll get type errors everywhere it's used. Once all its references have been removed, you can safely delete it from the UI.

This enables a type-safe, compiler-driven workflow to clean up a flag:

1. Deprecate a flag from the UI
2. Regenerate your client and fix the type errors to safely remove all the flag's references
3. Deploy your code changes
4. Delete the flag from the UI


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hypertune.com/concepts/flag-deprecation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
