schema = r.json() print("============= [SCHEMA] ===============") print("e.g: \033[92mname\033[0m[\033[94mType\033[0m]: arg (\033[93mType\033[0m!)\n") for types in schema['data']['__schema']['types']: if types['kind'] == "OBJECT": print(types['name']) if not "__" in types['name']: for fields in types['fields']: field_type = "" try: field_type = fields['type']['ofType']['name'] except Exception as e : pass print("\t\033[92m{}\033[0m[\033[94m{}\033[0m]: ".format(fields['name'], field_type), end='') for args in fields['args']: args_name = args.get('name') args_tkind = "" args_ttype = "" try: args_tkind = args['type']['kind'] except: pass try: args_ttype = args['type']['ofType']['name'] except Exception as e: pass print("{} (\033[93m{}\033[0m!), ".format(args_name, args_ttype), end='') print("")