graphql-voyager icon indicating copy to clipboard operation
graphql-voyager copied to clipboard

Don't add class to edges in iframe

Open taras opened this issue 6 years ago • 0 comments

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

2019-09-10 16 39 45

After

2019-09-10 16 42 27

taras avatar Sep 10 '19 20:09 taras