What is the current behavior?
Executing python manage.py graphql_schema --schema theapp.schema --out=-.graphql results in
Traceback (most recent call last):
File "/theapp/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/env/lib/python3.9/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "/env/lib/python3.9/site-packages/django/core/management/base.py", line 369, in execute
output = self.handle(*args, **options)
File "/env/lib/python3.9/site-packages/graphene_django/management/commands/graphql_schema.py", line 115, in handle
self.get_schema(schema, out, indent)
File "/env/lib/python3.9/site-packages/graphene_django/management/commands/graphql_schema.py", line 66, in get_schema
self.stdout.write(print_schema(schema))
File "/env/lib/python3.9/site-packages/graphql/utilities/print_schema.py", line 39, in print_schema
return print_filtered_schema(
File "/env/lib/python3.9/site-packages/graphql/utilities/print_schema.py", line 57, in print_filtered_schema
directives = filter(directive_filter, schema.directives)
File "/env/lib/python3.9/site-packages/graphene/types/schema.py", line 552, in __getattr__
raise AttributeError(f'Type "{type_name}" not found in the Schema')
AttributeError: Type "directives" not found in the Schema
python manage.py graphql_schema --schema theapp.schema --out=-.graphql
results inExecuting
python manage.py graphql_schema --schema app.schema --out=schema.graphql
succeeds with
If you look in the code, the former does:
self.stdout.write(print_schema(schema))
the latter does:
outfile.write(print_schema(schema.graphql_schema))
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)