fix: KeyError: 'data'

In some cases it is not possible to download the schema, in this case I added a condition to not return an error.
pull/40/head
Arthur A 2022-02-21 02:07:19 -03:00 committed by GitHub
parent 98997bd7cf
commit 2a559778e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,11 @@ def dump_schema(url, method, graphversion, headers, use_json, proxy):
line = 0
if 'data' not in schema:
print('[+] Unable to download schema.')
exit()
for line, types in enumerate(schema['data']['__schema']['types']):
if types['kind'] == "OBJECT":