Support for Schema Invalidation #5447
-
I have a rather unusual scenario in which I'm generating a graphql schema over a data source whose structure may change periodically (e.g fields being added/removed etc). Not being familiar with Hot Chocolote's inner workings (I've only used graphql-dotnet previously) I'm not sure how to go about invalidating the schema of a running graphql server instance so that it can be rebuilt on the next request, for instance using a cache. I've thought of an alternative way that instead builds the invalidation into the resolvers but I'm not sure if the request executor would realize that a graphql type has changed and update any introspection responses accordingly. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Not sure how you are building your dynamic schemas at the moment, but there is You can find a full example here: https://github.com/ChilliCream/hotchocolate-examples/tree/master/misc/TypeModules |
Beta Was this translation helpful? Give feedback.
Not sure how you are building your dynamic schemas at the moment, but there is
ITypeModule
which also supports invalidation: https://chillicream.com/blog/2021/09/27/hot-chocolate-12#dynamic-schemasYou can find a full example here: https://github.com/ChilliCream/hotchocolate-examples/tree/master/misc/TypeModules