Question: Programatically recreate the schema using graphql-spring-boot #243
Replies: 11 comments
-
That would be a very nice enhancement which isn't supported at the moment. Do you mean in combination with spring devtools or JRebel? Or some other use case? |
Beta Was this translation helpful? Give feedback.
-
I was thinking to trigger it which custom application logic (detect a text file was changed). |
Beta Was this translation helpful? Give feedback.
-
Sure, but when I think of the use cases where you would need to reload the schema it would be when the schema actually changed, e.g. when you added a new query and the resolver to actually return that data. That means those code changes have to be compiled too, hence my question about JRebel or spring-devtools. Or do you have a different use case in mind? |
Beta Was this translation helpful? Give feedback.
-
No, the will be no "code change", just a text file change that will trigger a runtime recreation of the schema. No code changes. But this new recreated schema would need to be served by the servlet and that is the problem here. |
Beta Was this translation helpful? Give feedback.
-
From your original description I understand that you create the GraphQLSchema programmatically, right? So that would mean that you would also programmatically create the update of that GraphQLSchema as well, correct? Then you would "just" need a way for the servlet to use that updated schema instead of the original one. Correct? |
Beta Was this translation helpful? Give feedback.
-
This could also be trigger by a schema message from Queue. Let's say I have a downstream system that is responsible for Data access layer. All the schema changes could be dynamically loaded. This will enable the data layer changes to seamlessly integrate to GQL queries. |
Beta Was this translation helpful? Give feedback.
-
Our use case is the following: we have customizable data model, so we need the ability to update the schema. The feature would be very useful to us. |
Beta Was this translation helpful? Give feedback.
-
After some investigation we are going to use custom |
Beta Was this translation helpful? Give feedback.
-
There is some interesting discussion: How to update GraphQl Schema in runtime? |
Beta Was this translation helpful? Give feedback.
-
Useful link @petronika. Anybody is welcome to contribute and try to come up with a solution and PR for this. There are quite some open issues at the moment, and I don't have the time at the moment to work on this one. |
Beta Was this translation helpful? Give feedback.
-
I have a programatically built schema using a GraphQLSchema bean.
Is there a way to programatically trigger its recreation and update the schema without restart the whole spring boot application?
PS: I asked in Stack Overflow but had no answear.
Beta Was this translation helpful? Give feedback.
All reactions