[BUG] Pydantic model `QueryParameter` not returning json dict in `GraphQLQuerier.post_graph_ql`
Opened this issue · 0 comments
koksang commented
Problem
- When trying to run code cell 1 in example notebook, it complains about
TypeError: Object of type QueryParameter is not JSON serializable
. - Seems to me like when we have query with parameters, the
QueryParameter
pydantic model is not returned as json dict beforeGraphQLQuerier.post_graph_ql
function happens. - Hence in httpx request, it is unable to encode parameters which is a list of
QueryParameter
objects rather than json text.
Screenshot
How to replicate the problem?
- I use poetry to install based on pyproject.toml from this repo and simply run the example
Potential solutions
- Check parameters from variables argument in
GraphQLQuerier.post_graph_ql
function before calling the api