Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @Refreshable #485

Open
johndevs opened this issue Dec 16, 2023 · 1 comment
Open

Support @Refreshable #485

johndevs opened this issue Dec 16, 2023 · 1 comment
Labels
type: enhancement New feature or request

Comments

@johndevs
Copy link

Feature description

I am generating the the GraphQL schema at runtime and I'd wish to update the schema when an external modification is made.

Preferably I'd like to use the @Refreshable annotation as that is what is used elsewhere and can easily be triggered via a REST end-point.

e.g

@Bean
@Refreshable
public GraphQL graphQL() {
...

}

Unfortunately this is not possible currently due to GraphQL missing a default constructor.

@johndevs
Copy link
Author

As a work-around I was able to achieve it by using

@Bean
@Replaces(GraphQLInvocation.class)
@Refreshable
public GraphQLInvocation graphQLInvocation(GraphQL graphQL,
                                           GraphQLExecutionInputCustomizer graphQLExecutionInputCustomizer,
                                           @Nullable BeanProvider<DataLoaderRegistry> dataLoaderRegistry) {
        return new DefaultGraphQLInvocation(graphQL, graphQLExecutionInputCustomizer, dataLoaderRegistry);
}

@sdelamo sdelamo added the type: enhancement New feature or request label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants