mirror of
https://github.com/graphql-python/graphene.git
synced 2025-04-27 13:03:41 +03:00
9 lines
272 B
Python
9 lines
272 B
Python
def get_type_for_model(schema, model):
|
|
schema = schema
|
|
types = schema.types.values()
|
|
for _type in types:
|
|
type_model = hasattr(_type, '_meta') and getattr(
|
|
_type._meta, 'model', None)
|
|
if model == type_model:
|
|
return _type
|