You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create a custom GraphQlSource so that I can change out the GraphQlSchema based on user privileges (show one schema for admins and another schema for non-admins). Right now, the GraphQlSource created in GraphQlAutoConfiguration is always a FixedGraphQlSource. I can override the bean, but I have to copy all the code in GraphQlAutoConfiguration if I want the same functionality that already exists.
It would be nice if there was a way to have GraphQlAutoConfiguration create a non FixedGraphQlSource. One possible idea is to not have it call GraphQlSource.schemaResourceBuilder() but instead have that be a bean that can then be overridden. Or add a customizer that can take the generated FixedGraphQlSource and generate a custom GraphQlSource based on it.
The text was updated successfully, but these errors were encountered:
You could use a BeanPostProcessor to decorate the GraphQlSource bean.
That said, the original idea with GraphQlSource was to be a point of flexibility, so we could provide a more first-class way to choose the implementation by decorating the simple FixedGraphQlSource through a method like this on GraphQlSource.Builder:
I would like to create a custom GraphQlSource so that I can change out the GraphQlSchema based on user privileges (show one schema for admins and another schema for non-admins). Right now, the GraphQlSource created in GraphQlAutoConfiguration is always a FixedGraphQlSource. I can override the bean, but I have to copy all the code in GraphQlAutoConfiguration if I want the same functionality that already exists.
It would be nice if there was a way to have GraphQlAutoConfiguration create a non FixedGraphQlSource. One possible idea is to not have it call GraphQlSource.schemaResourceBuilder() but instead have that be a bean that can then be overridden. Or add a customizer that can take the generated FixedGraphQlSource and generate a custom GraphQlSource based on it.
The text was updated successfully, but these errors were encountered: