-
Bug
-
Resolution: Fixed
-
Neutral
-
1.1.5
Steps to reproduce
- Create decoration file as follows:
<light-module>/decorations/graphql-core/graphqlTypes/asset.yaml
enabled=false
- Restart the instance
- Launch graphQL app
Expected results
App opens correctly
Actual results
An error occurs:
{ "status": 500, "errors": [ "An internal server occurred, please check the log file" ] }
Logs show the following error:
ERROR info.magnolia.graphql.core.http.GraphQLServlet : Failed to execute the GraphQL query graphql.AssertException: type Asset not found in schema
Workaround
Override GraphQLSchemaBuilder to filter disabled types
public class GraphQLSchemaBuilder { .filter(DefinitionProvider::isValid) .filter(provider -> provider.getProblems().stream().noneMatch(problem -> problem.getSeverityType() == DefinitionProvider.Problem.SeverityType.SEVERE)) .map(DefinitionProvider::get) + // PATCHED CHANGE: Filter disabled definitions + .filter(GraphQLDefinition::isEnabled) .collect(Collectors.toList()); for (final GraphQLDefinition graphQLDefinition : graphQLDefinitions) { graphQLDefinition.getTypes()
Development notes
Acceptance criteria