mirror of
https://github.com/graphql-python/graphene.git
synced 2025-05-04 00:13:40 +03:00
11 lines
326 B
Python
11 lines
326 B
Python
from collections import OrderedDict
|
|
|
|
|
|
def copy_fields(like, fields, **extra):
|
|
_fields = []
|
|
for attname, field in fields.items():
|
|
field = like.copy_and_extend(field, attname=getattr(field, 'attname', None) or attname, **extra)
|
|
_fields.append(field)
|
|
|
|
return OrderedDict((f.name, f) for f in _fields)
|