mirror of
				https://github.com/graphql-python/graphene.git
				synced 2025-10-31 16:07:27 +03:00 
			
		
		
		
	chore: Make Union meta overridable (#1583)
This PR makes the Union Options configurable, similar to how it works with ObjectTypes --------- Co-authored-by: Erik Wrede <erikwrede@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									ccae7364e5
								
							
						
					
					
						commit
						3ed7bf6362
					
				|  | @ -51,12 +51,14 @@ class Union(UnmountedType, BaseType): | |||
|     """ | ||||
| 
 | ||||
|     @classmethod | ||||
|     def __init_subclass_with_meta__(cls, types=None, **options): | ||||
|     def __init_subclass_with_meta__(cls, types=None, _meta=None, **options): | ||||
|         assert ( | ||||
|             isinstance(types, (list, tuple)) and len(types) > 0 | ||||
|         ), f"Must provide types for Union {cls.__name__}." | ||||
| 
 | ||||
|         if not _meta: | ||||
|             _meta = UnionOptions(cls) | ||||
| 
 | ||||
|         _meta.types = types | ||||
|         super(Union, cls).__init_subclass_with_meta__(_meta=_meta, **options) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user