Created
June 29, 2023 10:22
-
-
Save acao/e1a9527e21b4657a1772f70ceb44e370 to your computer and use it in GitHub Desktop.
Simple duplicate headers tab bug that causes tab creation on reload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Parcel Sandbox</title> | |
<style> | |
body { | |
height: 100%; | |
margin: 0; | |
width: 100%; | |
overflow: hidden; | |
} | |
#graphiql { | |
height: 100vh; | |
} | |
</style> | |
<script | |
crossorigin | |
src="https://unpkg.com/react@18/umd/react.development.js" | |
></script> | |
<script | |
crossorigin | |
src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" | |
></script> | |
<script crossorigin src="https://unpkg.com/graphiql/graphiql.js"></script> | |
<link rel="stylesheet" href="https://unpkg.com/graphiql/graphiql.min.css" /> | |
</head> | |
<body> | |
<div id="graphiql"></div> | |
</body> | |
<script> | |
function getSchemaUrl() { | |
return "https://graphiql-test.netlify.app/.netlify/functions/schema-demo"; | |
} | |
const root = ReactDOM.createRoot(document.getElementById("graphiql")); | |
root.render( | |
React.createElement(GraphiQL, { | |
fetcher: GraphiQL.createFetcher({ | |
url: getSchemaUrl() | |
}), | |
headers: '{"a": "b"}', | |
defaultEditorToolsVisibility: true, | |
isHeadersEditorEnabled: true, | |
shouldPersistHeaders: false, | |
}) | |
); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment