mirror of
				https://github.com/graphql-python/graphene.git
				synced 2025-11-01 00:17:26 +03:00 
			
		
		
		
	Fixed Python3 errors
This commit is contained in:
		
							parent
							
								
									bc3d176b4e
								
							
						
					
					
						commit
						b377eb6230
					
				|  | @ -6,7 +6,7 @@ from graphql.core.type import ( | ||||||
|     GraphQLID as ID |     GraphQLID as ID | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| from graphene import signals | # from graphene import signals | ||||||
| 
 | 
 | ||||||
| from graphene.core.schema import ( | from graphene.core.schema import ( | ||||||
|     Schema |     Schema | ||||||
|  |  | ||||||
|  | @ -53,16 +53,22 @@ class ObjectTypeMeta(type): | ||||||
| 
 | 
 | ||||||
|         assert not (new_class._meta.interface and new_class._meta.mutation) |         assert not (new_class._meta.interface and new_class._meta.mutation) | ||||||
| 
 | 
 | ||||||
|  |         input_class = None | ||||||
|  |         if new_class._meta.mutation: | ||||||
|  |             input_class = attrs.pop('Input', None) | ||||||
|  | 
 | ||||||
|         # Add all attributes to the class. |         # Add all attributes to the class. | ||||||
|         for obj_name, obj in attrs.items(): |         for obj_name, obj in attrs.items(): | ||||||
|             new_class.add_to_class(obj_name, obj) |             new_class.add_to_class(obj_name, obj) | ||||||
| 
 | 
 | ||||||
|         if new_class._meta.mutation: |         if new_class._meta.mutation: | ||||||
|             assert hasattr(new_class, 'mutate'), "All mutations must implement mutate method" |             assert hasattr(new_class, 'mutate'), "All mutations must implement mutate method" | ||||||
|             Input = getattr(new_class, 'Input', None) | 
 | ||||||
|             if Input: |         if input_class: | ||||||
|                 input_type = type('{}Input'.format(new_class._meta.type_name), (Input, ObjectType), Input.__dict__) |             items = dict(input_class.__dict__) | ||||||
|                 setattr(new_class, 'input_type', input_type) |             items.pop('__dict__', None) | ||||||
|  |             input_type = type('{}Input'.format(new_class._meta.type_name), (ObjectType, ), items) | ||||||
|  |             new_class.add_to_class('input_type', input_type) | ||||||
| 
 | 
 | ||||||
|         new_class.add_extra_fields() |         new_class.add_extra_fields() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user