graphql-voyager
graphql-voyager copied to clipboard
Don't add class to edges in iframe
Motivation
My team and I are making a Gatsby/NetlifyCMS schema editor that uses graphql-voyager as a visualization tool. When editing the schema document, <GraphQLVoyager/> component is rendered in a preview pane which runs in an iframe. In this particular setup, mouseover event throws an error because edge source can't be found.
This breaks the preview mechanism because it bubbles the error to the UI.
Approach
This PR adds a check to ensure that $edge is found before calling classList.
Screenshot
Before

After
