I faced some problems during rewriting my methods to the apollo-graphql stack. For example, imagine that I had that kind of schema in mongo:
{
_id: ...
image: {
width: ...
height: ...
}
thumb: {
width: ...
height: ...
}
}
How do I need to perform a mutation to insert it? It seems that graphql should be a flat object?
Is there any way to send variables something like this?
gql`mutation insertImage(
$image.width: Int!
$image.height: Int!
$thumb.width: Int!
$thumb.height: Int!
)
And overall, how to define all this in schema? Or it better to rewrite this mongo table to a plain structure?