[MGNLGQL-54] Schema generation fails when referenced content type doesn't exist Created: 04/Sep/20  Updated: 20/Oct/20  Resolved: 08/Oct/20

Status: Closed
Project: Magnolia GraphQL
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Neutral
Reporter: Jaroslav Simak Assignee: Robert Šiška
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 0.5d
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLCT-162 Report problem in definition app if n... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: GraphQL Phase 1
Sprint: HL & LD 11, HL & LD 13
Story Points: 3

 Description   

Schema generation fails in the following scenario:

  • let there be a content type with name book.
  • content type book is referencing another content type called bookCategory
  • content type bookCategory is however not present in the registry to whatever reason and it's GraphQL type is thus not generated
  • schema generation will fail because GraphQL type Book is expecting GraphQL type BookCategory to exist

Error:

2020-09-04 13:45:15,574 ERROR info.magnolia.event.SimpleEventBus                : Exception caught when dispatching info.magnolia.graphql.core.GraphQLDefinitionChangedEvent with info.magnolia.graphql.core.GraphQLProvider$$Lambda$878/1830549084 eventHandler.
graphql.AssertException: type Event not found in schema
	at graphql.Assert.assertNotNull(Assert.java:15) ~[graphql-java-14.1.jar:?]
	at graphql.schema.GraphQLTypeResolvingVisitor.handleTypeReference(GraphQLTypeResolvingVisitor.java:46) ~[graphql-java-14.1.jar:?]
	at graphql.schema.GraphQLTypeResolvingVisitor.visitGraphQLTypeReference(GraphQLTypeResolvingVisitor.java:41) ~[graphql-java-14.1.jar:?]
	at graphql.schema.GraphQLTypeReference.accept(GraphQLTypeReference.java:55) ~[graphql-java-14.1.jar:?]
	at graphql.schema.SchemaTraverser$TraverserDelegateVisitor.enter(SchemaTraverser.java:72) ~[graphql-java-14.1.jar:?]
	at graphql.util.Traverser.traverse(Traverser.java:144) ~[graphql-java-14.1.jar:?]
	at graphql.schema.SchemaTraverser.doTraverse(SchemaTraverser.java:59) ~[graphql-java-14.1.jar:?]
	at graphql.schema.SchemaTraverser.depthFirst(SchemaTraverser.java:51) ~[graphql-java-14.1.jar:?]
	at graphql.schema.SchemaTraverser.depthFirst(SchemaTraverser.java:38) ~[graphql-java-14.1.jar:?]
	at graphql.schema.SchemaUtil.replaceTypeReferences(SchemaUtil.java:113) ~[graphql-java-14.1.jar:?]
	at graphql.schema.GraphQLSchema$Builder.buildImpl(GraphQLSchema.java:533) ~[graphql-java-14.1.jar:?]
	at graphql.schema.GraphQLSchema$Builder.build(GraphQLSchema.java:515) ~[graphql-java-14.1.jar:?]
	at info.magnolia.graphql.core.schema.builder.GraphQLSchemaBuilder.build(GraphQLSchemaBuilder.java:131) ~[magnolia-graphql-core-1.0-SNAPSHOT.jar:?]


 Comments   
Comment by Simon Lutz [ 22/Sep/20 ]

Superseded by MGNLCT-162.

Comment by Robert Šiška [ 02/Oct/20 ]

Reopening, because there's still some minor handling needed from graphql side like unregistering existing types when CT gets invalid, etc.

Generated at Mon Feb 12 05:52:07 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.