Closed Kinzeng closed 4 years ago
Sorry for the slow response but i don't really have a clue as to what might be going wrong. Try opening a PR with a failing test.
@Kinzeng Can you try again the latest version and report back.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is a problem I believe if you're writing your own resolvers....
The JSONType when it encouters a variable in parsing replaces it with the _.property lodash function. Then if you're using the resolver
function it knows how to unwrap those with the whereQueryVarsToValues
. However if you're rolling your own resolver, that won't happen and yes you end up with functions where there should be primitives.
When I try to make a query using query variables, it replaces the value with a function instead, thus causing sequelize to throw an error
Invalid value [Function]
. Example: query:variables:
I edited the code in
node_modules
and this is what's printed out in jsonType.js as the value foruser
:which returns this as the final object for the
where
argument:After looking at the source code, I see that in jsonType.js, for variables you are returning
_.property(ast.name.value)
. Lodash documentation says that_.property
returns a function, so that could be cause of the issues. If this is not the problem, what can I do to get around this?