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
So the default resolver should resolve the field name if it exists, and if the field name is a function, it should call that. However when passing a resolvers to mergeSchemas, the default resolver resolution does not happen for functions.
Expected result
If field is a function, function should be called and the return value of the function is assigned to the field.
Actual result
A type error Int cannot represent non-integer value: [function fieldB]
The text was updated successfully, but these errors were encountered:
chrischen
changed the title
Passing resolvers to mergeSchemas prevents default resolution of fields with functions.
Default resolver for fields that are functions does not work when passing resolvers to mergeSchemas
Feb 8, 2019
I managed to fix this issue by putting the resolvers in a makeExecutableSchema call that afterwards gets passed to mergeSchemas, rather than passing resolvers to mergeSchemas.
So the default resolver should resolve the field name if it exists, and if the field name is a function, it should call that. However when passing a resolvers to mergeSchemas, the default resolver resolution does not happen for functions.
Expected result
If field is a function, function should be called and the return value of the function is assigned to the field.
Actual result
A type error
Int cannot represent non-integer value: [function fieldB]
This glitch shows the problem: https://glitch.com/edit/#!/intelligent-buckaroo
The text was updated successfully, but these errors were encountered: