What to do when you rename or change a doctype?
Closed this issue · 1 comments
This one was sparked off by re-reading Janaes post about switching DocTypes. When a developer changes a doctype the API would be broken for anyone external using it. Lets say we rename a Hotel doctype to Accommodation to make it more generic (a villa is not a hotel for instance). Now no one can have a query that references Hotel, they will all break (well return null anyway).
To be fair having it break might be ok but ideally we want some backwards compat. I pondered keeping a list of renames around or possibly a list of Aliases that we could set (in an xml file for example) and when we build our schema up on start up we can create a bunch of Types that just inherit from the new Type. So a Hotel(id:123) would work just like Accommodation(id:123) under the hood. Ideally we would return an Error in our response too so that users know that they shouldn't be using it. This would work but fields that have changed on the doctype would blow up too and theres no way around that that I can think of?
Ideally don't change doctypes if they are out in the wild!
Again this is here more so we know we've thought about it than somethign we should "fix" but something to think over.
Chat I had with Joe about this is here: https://gitter.im/graphql-dotnet/graphql-dotnet?at=5b881948f5402f32aab353f5
Hi
Just wanted to let you know that the project is moving to the Umbraco Community GitHub organisation, so we are closing all existing issues.
If you think your issue is still relevant, please feel free to reopen it.
/Rasmus