Getting introspection from shiphero graphql with Python

Hi there!

I’m trying to generate que json file from the official doc

python3 -m sgqlc.introspection \
 --exclude-deprecated \
 --exclude-description \
 -H "Authorization: Bearer YOUR_TOKEN" \ 
http://public-api.shiphero.com/graphql \ 
sh_public_api.json

But i’m getting the error:

{'errors': [{'message': 'Must provide query string.'}], 'exception': <HTTPError 400: 'BAD REQUEST'>, 'status': 400, 'headers': <http.client.HTTPMessage object at 0x10993df10>}

¿Could you help me please?

Nevermind, i found a solution

The URL was wrong; just change to https and works

python3 -m sgqlc.introspection
–exclude-deprecated
–exclude-description
-H “Authorization: Bearer YOUR_TOKEN” \
https://public-api.shiphero.com/graphql \
sh_public_api.json

1 Like