Skip to content

update swapi to use GraphiQL 5 with Monaco editor and React 19 #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 17, 2025

Conversation

dimaMachina
Copy link
Contributor

@dimaMachina dimaMachina commented Jul 10, 2025

per official example https://github.com/graphql/graphiql/blob/main/examples/graphiql-cdn/index.html

(tested locally)

also include tiny fix of confusing console error module "@emotion/is-prop-valid" not found, ref graphql/graphiql#4072

@dimaMachina dimaMachina changed the title update swapi to use GraphiQL 5 with Monaco editor update swapi to use GraphiQL 5 with Monaco editor and React 19 Jul 10, 2025
}
</script>
</head>
<script type="module">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This <script> tag is neither in <body> nor <head>?

Copy link
Contributor Author

@dimaMachina dimaMachina Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch, didn't move lines enough from <body>

});
}

const container = document.getElementById('graphiql');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this works despite the call being before the element exists because it's <script type="module"> and there's some imports that cause it to run a tick later?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah it's because <script type="module"> is always deferred.

@benjie benjie merged commit e2a2b91 into graphql:master Jul 17, 2025
2 checks passed
@dimaMachina dimaMachina deleted the graphiql-5 branch July 17, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants