mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-25 19:14:11 +03:00
Fixed a bug that was causing graphql_schmea command to not import properly
This commit is contained in:
parent
bcb408f921
commit
1cb5f24f5b
|
@ -57,8 +57,15 @@ class Command(CommandArguments):
|
|||
|
||||
def handle(self, *args, **options):
|
||||
options_schema = options.get('schema')
|
||||
if options_schema:
|
||||
schema = importlib.import_module(options_schema)
|
||||
|
||||
if options_schema and type(options_schema) is str:
|
||||
module_str, schema_name = options_schema.rsplit('.', 1)
|
||||
mod = importlib.import_module(module_str)
|
||||
schema = getattr(mod, schema_name)
|
||||
|
||||
elif options_schema:
|
||||
schema = options_schema
|
||||
|
||||
else:
|
||||
schema = graphene_settings.SCHEMA
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user