3

getting the following import error in my Django(graphene) application, is there a workaround ?

from graphene.utils.str_converters import to_camel_case, to_const
ImportError: cannot import name 'to_const'
bitbuoy
  • 353
  • 2
  • 8

2 Answers2

1

Error : ? the above error results from package upgrade, that causes mismatches in dependencies

Solution : ? To clear the error above i downgraded the following packages to the versions shown below:

aniso8601==7.0.0 
graphene==2.1.8
graphql-core==2.3.2
graphql-relay==2.0.1

and the error cleared.

bitbuoy
  • 353
  • 2
  • 8
1

Looks to me like to_const does not exist in the module str_converters. Which is why you are getting this error.

Source: https://github.com/graphql-python/graphene/blob/master/graphene/utils/str_converters.py

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • yea, figured that out versions of graphene 3.0.0 and above to_const class has been removed from the str_convertes module, Thanks. – bitbuoy May 17 '22 at 19:06