You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: Windows 10, ariadne==0.5, graphql-core-next==1.1.0
Recently upgraded to the latest version of graphql-core-next, and I'm getting the following exception when using extend_schema:
File "C:\Anaconda3\envs\structor\lib\site-packages\graphql\utilities\extend_schema.py", line 335, in extend_schema
type_map[existing_type_name] = extend_named_type(existing_type)
File "C:\Anaconda3\envs\structor\lib\site-packages\graphql\utilities\extend_schema.py", line 150, in extend_named_type
return extend_scalar_type(type_)
File "C:\Anaconda3\envs\structor\lib\site-packages\graphql\utilities\extend_schema.py", line 225, in extend_scalar_type
kwargs = type_.to_kwargs()
File "C:\Anaconda3\envs\structor\lib\site-packages\graphql\type\definition.py", line 397, in to_kwargs
if getattr(self.parse_literal, "__func__")
AttributeError: 'function' object has no attribute '__func__'
This new version tries to get the __func__ attribute of the literal parser for a custom scalar, which assumes that the parser is a bound method. There are many libraries, incl. ariande, that attach such parsers (and resolvers) after the scalars have been initialised. Therefore, these newly attached methods are no longer bound. I see no reason for this constraint, so could you please fix?
Activity
Fix issue #43 with getting parse_literal via to_kwargs()
Cito commentedon Jul 15, 2019
Right, that's a bug. Can you check whether the above fix solves the problem? I'll deploy a bugfix release then.
delyanr commentedon Jul 16, 2019
That seems to do it. Thanks for the quick one!
Fix issue #43 with getting parse_literal via to_kwargs()
Cito commentedon Jul 17, 2019
Thank you for the bug report. This is now fixed in core-next 1.1.1 and core 3.0.0a1.