Due to how the GraphQL <-> persistence layer worked, I needed to access Game.previous_file_state, but ...
... since the GraphQL codegen I wrote turns any non-primitive type into a Resolver, there is no Game.previous_file_state, it's Game.previous_file_state(async_graphql::context::Context) and ...
... since we don't have access to the graphql context all of the time, something had to change.
My solution was to use the "Db" versions of the duplicated types as much as possible, and they have handy to_graphql_type() methods.
The UI was also a bit of a chore, due to the fact that the list of files isn't in the form state.
This got kind of hairy, all due to my own doing:
Game.previous_file_state
, but ...Game.previous_file_state
, it'sGame.previous_file_state(async_graphql::context::Context)
and ...My solution was to use the "Db" versions of the duplicated types as much as possible, and they have handy
to_graphql_type()
methods.The UI was also a bit of a chore, due to the fact that the list of files isn't in the form state.
Closes https://github.com/mikew/wadpunk/issues/28
Preview
https://github.com/mikew/wadpunk/assets/4729/7778081c-7609-43c4-899f-8f901b4fcbd5