mirror of
				https://github.com/graphql-python/graphene-django.git
				synced 2025-11-01 00:17:38 +03:00 
			
		
		
		
	Merge pull request #6 from BossGrand/master
Fixed a bug that was causing graphql_schmea command to not import properly
This commit is contained in:
		
						commit
						b65afdc8c9
					
				|  | @ -57,8 +57,15 @@ class Command(CommandArguments): | ||||||
| 
 | 
 | ||||||
|     def handle(self, *args, **options): |     def handle(self, *args, **options): | ||||||
|         options_schema = options.get('schema') |         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: |         else: | ||||||
|             schema = graphene_settings.SCHEMA |             schema = graphene_settings.SCHEMA | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user