I'm learning GraphQL with the juniper crate and I'm trying to send Mutations encoded as JSON to the GraphQL server. I have two questions because the answer for one may solve the problem for the other.
I created the JSONified Mutation query using this Rust code.
When I print out the JSON result, I get this.
After I POST the request, I receive this for the error.
So now my questions:
- Is the JSONified Mutation query in the correct format?
- I don't fully understand the error message sent back by the server; I'm thinking that it's telling me that the Owner data type to use as an input type to a Mutation. How can I make it a valid input type, if so? I see that GraphQL has the concept of Scalars, and juniper has traits like ToInputValue, and I'm wondering if it's possible to do so for Owner, but I'm a bit lost on how to implement the trait.