from __future__ import annotations

import json
import os
import sys

ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if ROOT not in sys.path:
    sys.path.insert(0, ROOT)

from worklib import admin_data  # noqa: E402
from worklib.graphql_client import DEFAULT_COMPANY_ID, execute_graphql  # noqa: E402


def main() -> None:
    token = admin_data.get_access_token_from_env()
    query = """
query IntrospectRequestPassInput {
  __type(name: "RequestPassInput") {
    kind
    name
    inputFields {
      name
      type {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
          }
        }
      }
    }
  }
}
""".strip()
    resp = execute_graphql(query=query, variables=None, company_id=DEFAULT_COMPANY_ID, access_token=token)
    print(json.dumps(resp, ensure_ascii=False, indent=2))


if __name__ == "__main__":
    main()

