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

Replace the default Nashorn-based ComplexityFunction #452

Closed
kaqqao opened this issue Apr 13, 2023 · 1 comment
Closed

Replace the default Nashorn-based ComplexityFunction #452

kaqqao opened this issue Apr 13, 2023 · 1 comment

Comments

@kaqqao
Copy link
Member

kaqqao commented Apr 13, 2023

Nashorn was removed from JDK15+. The Spring project will get a SpEL-based implementation, but core SPQR needs an alternative that's not dependent on Spring. A simple implementation of Dijkstra's shunting yard algo will suffice.

@kaqqao kaqqao closed this as completed in 9225546 Apr 13, 2023
@kaqqao
Copy link
Member Author

kaqqao commented Apr 13, 2023

The JavaScript (Nashorn) based evaluator is still available (and supported as usual), but must be configured explicitly:

GraphQL exe = GraphQLRuntime.newGraphQL(schema)
                .maximumQueryComplexity(maxComplexity, new JavaScriptEvaluator())
                .build();

If Nashorn engine isn't available (JDK15+), the dependency must be added by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant