- commit
- 63254882193a84a5e2135d012465075ac12cce17
- parent
- e6470c2564f534f03c7ad365f4880c90aa07ecd6
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2025-12-20 21:32
introspect: include enum values
Diffstat
| M | introspect.py | 14 | ++++++++++---- |
1 files changed, 10 insertions, 4 deletions
diff --git a/introspect.py b/introspect.py
@@ -81,11 +81,17 @@ async def main(): 81 81 for t in data['data']['__schema']['types']: 82 82 short[t['name']] = { 83 83 'kind': t['kind'],84 -1 'description': t['description'],85 -1 'fields': {86 -1 f['name']: f['type']['name'] for f in (t['fields'] or [])87 -1 },88 84 } -1 85 if t['description']: -1 86 short[t['name']]['description'] = t['description'] -1 87 if t['fields']: -1 88 short[t['name']]['fields'] = { -1 89 f['name']: f['type']['name'] for f in t['fields'] -1 90 } -1 91 if t['enumValues']: -1 92 short[t['name']]['enumValues'] = [ -1 93 v['name'] for v in t['enumValues'] -1 94 ] 89 95 print(json.dumps(short, indent=2)) 90 96 91 97