Cells with Mutation

Ok, so I’ve been playing with the idea of Mutation support for cells and have been poking around a bit

Hacking a one line change (ok, 2, if you count importing useMutation) in createCell.tsx will call the useMutation instead of the useQuery (if you code a mutation into the QUERY)

export type Query = React.JSXElement
const Query = ({ children, query, ...rest }: QueryProps) => {
  const result = ('mutation' === query.definitions[0].operation) ? useQuery(query, rest) :  useMutation(query, rest)
  return result ? children(result) : null

I made this change in the distributed createCell.js and it called useMutation, but then it complains that the data return is null and it cannot render Success

I feel like we’re close…

Ah, the useMutation returns a completely different shape

Even executing the resulting mutation returns a different shape, a promise

I’ll have to think on this some more…