Usage (using get-graphql-schema to fetch the schema):
get-graphql-schema https://hackerone.com/graphql --json | jq -rf graphql.jq
Supports Union types, Enum types, Interfaces, Input Objects and regular Objects.
See bored-engineer/hackeroni-ql for an example library generated with this script.