# `mix grephql.download_schema`
[🔗](https://github.com/fahchen/grephql/blob/v0.10.1/lib/mix/tasks/grephql.download_schema.ex#L1)

Downloads a GraphQL schema via introspection and saves it as JSON.

## Usage

    mix grephql.download_schema --endpoint URL --output PATH [--header "Key: Value"]

## Options

  * `--endpoint` (required) — the GraphQL endpoint URL
  * `--output` (required) — file path to save the schema JSON
  * `--header` — HTTP header in `"Key: Value"` format (may be repeated)

## Examples

    mix grephql.download_schema \
      --endpoint https://api.example.com/graphql \
      --output priv/schemas/schema.json

    mix grephql.download_schema \
      --endpoint https://api.example.com/graphql \
      --output priv/schemas/schema.json \
      --header "Authorization: Bearer token123"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
