Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

explorer.ts 510 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  1. const explorerUrl =
  2. location.hostname === 'localhost'
  3. ? 'http://localhost:3000'
  4. : 'https://graphql.github.com/explorer'
  5. // Pass non-search query params to Explorer app via the iFrame
  6. export default function () {
  7. const graphiqlExplorer = document.getElementById('graphiql') as HTMLIFrameElement
  8. const queryString = window.location.search
  9. if (!(queryString && graphiqlExplorer)) return
  10. window.onload = () => {
  11. graphiqlExplorer?.contentWindow?.postMessage(queryString, explorerUrl)
  12. }
  13. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...