Skip to content

Commit d17b546

Browse files
dimaMachinaacaogithub-actions[bot]TallTedyaacovCR
authored
GraphiQL 5 (#3979)
* enter rc * Revert "revert #3946 to have support …" (#3972) This reverts commit 7054591. * [1] various refactor after zustand migration (#3949) * use execution store * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * default query * persist headers * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * reduce rerenders * add logs * try * cleanup * cspell * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * fixes * fixes * fixes * fixes * fixes * Delete .changeset/five-cars-roll.md * Apply suggestions from code review * Apply suggestions from code review * Update .changeset/chilly-sloths-heal.md * Update .changeset/chilly-sloths-heal.md * Update .changeset/chilly-sloths-heal.md * Update release.yml * [2] remove `useQueryEditor`, `useVariableEditor`, `useHeaderEditor`, `useResponseEditor` hooks (#3950) * use execution store * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * default query * persist headers * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * reduce rerenders * add logs * try * cleanup * cspell * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * fixes * fixes * fixes * fixes * fixes * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * prettier * upd * move plugins check to store * upd * upd * refactor * refactor * upd * upd * upd * upd * upd * upd * lint fix * Delete .changeset/five-cars-roll.md * Update .changeset/warm-shoes-boil.md * fix build * update yarn.lock * [3] GraphiQL 5 x Monaco editor / Monaco-GraphQL / JSONC variables/headers (#3234) * use execution store * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * default query * persist headers * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * reduce rerenders * add logs * try * cleanup * cspell * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * fixes * fixes * fixes * fixes * fixes * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * prettier * upd * move plugins check to store * upd * upd * refactor * refactor * upd * upd * upd * upd * upd * upd * lint fix * all in one * yarn lokc * fix * yarn.lock * update babel.config.js * fix tests * Delete .changeset/five-cars-roll.md * fix build * fix netlify * update changeset * update yarn.lock * polish * polish * Merge branch 'main' into graphiql-5 # Conflicts: # yarn.lock * Update soft-cars-notice.md (#3987) * [4] Update graphiql examples, add GraphiQL 5 x Vite and GraphiQL 5 x Next.js examples (#3966) * use execution store * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * default query * persist headers * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * reduce rerenders * add logs * try * cleanup * cspell * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * fixes * fixes * fixes * fixes * fixes * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * prettier * upd * move plugins check to store * upd * upd * refactor * refactor * upd * upd * upd * upd * upd * upd * lint fix * all in one * yarn lokc * fix * yarn.lock * update babel.config.js * fix tests * update examples * yarn.lock * run yarn * add changeset * Delete .changeset/five-cars-roll.md * upd snapshot * trigger rebuild of netlify example * should fix netlify * and here * upd yarn.lock * ignore react and next.js example in changesets config.json * Update chilly-sloths-heal.md * Version Packages (rc) (#3981) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * merge conflicts * merge conflicts * graphiql 5: allow multiple independant instances on the same page (#3990) * upd * upd * upd * default query * persist headers * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * reduce rerenders * add logs * try * cleanup * cspell * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * fixes * fixes * fixes * fixes * fixes * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * prettier * upd * move plugins check to store * upd * upd * refactor * refactor * upd * upd * upd * upd * upd * upd * lint fix * all in one * yarn lokc * fix * yarn.lock * update babel.config.js * fix tests * update examples * yarn.lock * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * pick * provider * autocomplete leafs * editors * query editor * upd * upd * upd * useSynchronizeValue * synchronizeActiveTabValues * synchronizeActiveTabValues and setEditorValues * storeTabs * actions * setOperationFacts * cleanup * move editor logic to provider * add InnerGraphiQLProvider * move editor logic * move more * move schema * refactor plugins and graphiql * upd * upd * swap isIntrospecting and isFetching * cleanupDisposables * lint * add test-d typecheck test * gitignore * run yarn * fix graphiql build * use cn * fix history tests * fix tests * types check pass * run ayrn * run ayrn * tests pass * upd * Delete .changeset/five-cars-roll.md * Update packages/graphiql-plugin-doc-explorer/src/components/__tests__/doc-explorer.spec.tsx * fix run at cursor action * add run action for response editor * fix copy query action * copy query * fix prettify editors action * fix merge query action * polish * move `getAutoCompleteLeafs` * formatShortcutForOS * formatShortcutForOS * formatShortcutForOS * remove on click reference from variable editor * store on click reference in ref * polish * add changeset and allow override all default GraphiQL plugins * upd * better autocomplete for editor theme * try fix tests * merge conflicts and fix ClipboardItem is not defined * fix vitest and e2e * Update .changeset/beige-months-care.md * upd setup-files * upd monaco-editor mocks * fix lint * should works now! * polish * polish * polish * build pass on next 15.4 * remove unneeded actions * merge conflicts * Update .changeset/beige-months-care.md * Update .changeset/beige-months-care.md * rm next.js example because netlify fails * Update config.json * Version Packages (rc) (#3998) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: update graphiql-cdn example to show how to load workers with esm.sh (#3999) * upd * upd * upd * upd * upd * upd * upd * upd * debug go to definition issue on esm.sh * allow alpha releases * put monaco-editor/monaco-graphql as peerDep * try initialize mode.. * try initialize mode.. * upd * upd * upd * try * use interface * move to dependencies * try * try yet more time * debug * try browser field in package.json * try browser field in package.json * cleanup * update cdn example * update cdn example * Update .changeset/dull-balloons-warn.md * update cdn example * Update .changeset/dull-balloons-warn.md * graphiql 5: remove UMD builds (#4002) * upd * upd * upd * graphiql 5: remove `readOnly` prop, document `keyMap` prop was removed in migration guide (#4003) * upd * upd * upd * upd (#4004) * graphiql 5: support `externalFragments` prop and remove `validationRules` prop (#4005) * upd * upd * upd * externalFragments * externalFragments * externalFragments * remove unused types BaseSchemaConfig IDisposable JSONDiagnosticOptions IEvent FilePointer * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * add changeset * cspell * lint * lint * lint * graphiql 5: push field type on stack too before field (#4006) * push field type on stack too before field * add comment * graphiql 5: Use an additional `Alt` key for focus doc explorer search input instead of `Cmd/Ctrl+K` because monaco-editor has a built-in shortcut for `Cmd/Ctrl+K` (#4007) * upd * upd snapshots lines since graphql description was changed * upd * upd * upd * upd * upd * upd * upd * polish * polish * polish * graphiql 5: add f1 command as first item in shortcut table (#4008) * add f1 command as first item in shortcut table * add f1 command as first item in shortcut table * rollback * Version Packages (rc) (#4001) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: separate store actions from state, add `useGraphiQLActions` state (#4009) * add f1 command as first item in shortcut table * add f1 command as first item in shortcut table * rollback * refactor plugins * refactor editor * refactor execution * refactor schema * refactor schema * export actions * add SlicesWithActions * add types tests * execution * lint * editor refactoring * avoid calling get() in set() * fix state creators * useGraphiQLActions * add comment * fix type errors * fix type errors * more types check * more types check * more types check * upd * add changeset * Update editor.ts * Version Packages (rc) (#4012) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * [graphiql 5] fix: save last opened plugin in storage (#4011) * add f1 command as first item in shortcut table * add f1 command as first item in shortcut table * rollback * refactor plugins * refactor editor * refactor execution * refactor schema * refactor schema * export actions * add SlicesWithActions * add types tests * execution * lint * editor refactoring * avoid calling get() in set() * fix state creators * useGraphiQLActions * add comment * fix type errors * fix type errors * more types check * more types check * more types check * upd * add changeset * Update editor.ts * add initial values for execution store * add initial values for plugin store * add initial values for schema store * add initial values for schema store * external fragments * external fragments * add plugins * polish * polish * polish * polish * polish * polish * polish * polish * polish * polish * polish * polish * polish * add changeset * fix cypress * Version Packages (rc) (#4013) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: extract storage key constants (#4014) * upd * upd * Version Packages (rc) (#4015) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: extract graphiql sidebar to react component (#4017) * extract sidebar into component * upd * add changeset * fix cypress * Version Packages (rc) (#4018) * Version Packages (rc) * upd --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: run cypress tests in React strict mode (#4020) * run cypress tests in React strict mode * upd * upd * upd * Update packages/graphiql/cypress/e2e/tabs.cy.ts * Version Packages (rc) (#4021) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: set "importsNotUsedAsValues": "error" in tsconfig (#4025) * upd * upd * upd * upd * upd * set `"importsNotUsedAsValues": "error"` in tsconfig * add changeset * graphiql 5: fix GraphiQL 5 feedback (#4026) * fix GraphiQL 5 feedback * add deprecated.ts * add more deprecated * useExecutionContext * usePluginContext * useSchemaContext * useStorageContext * useHistoryContext * useExplorerContext * upd readme * upd readme * upd readme * polish * mention never rerender * upd * upd * fix toolbar * toolbar changes * upd * upd * upd * upd * fix graphiql footer overflow * add changeset * add changeset * prettier * Version Packages (rc) (#4027) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: Remove `query`, `variables`, `headers` and `response` props from `<GraphiQL />` (#3735) * changeset pre enter alpha * [graphiql-react/graphiql] new looks of tabs (#3644) * new looks of tabs * add graphiql react too * all fixes * more polishing * more * more * more * more * more * prettier * polish changeset * disable shrinking while changing the operation name * Update packages/graphiql-react/src/ui/tabs.css Co-authored-by: Ted Thibodeau Jr <[email protected]> * yarn i * apply new design changes * prettier * Update .changeset/thirty-spoons-call.md * fix cypress * this fix locally --------- Co-authored-by: Ted Thibodeau Jr <[email protected]> * [2] GraphiQL x Vite v5 (#3679) * new looks of tabs * add graphiql react too * all fixes * more polishing * more * more * more * more * more * prettier * polish changeset * disable shrinking while changing the operation name * Update packages/graphiql-react/src/ui/tabs.css Co-authored-by: Ted Thibodeau Jr <[email protected]> * yarn i * apply new design changes * prettier * vite more more more * fix demo * fix cspell * fix dev * update cypress to v13 * upd cache key * Update .changeset/thirty-spoons-call.md * Update packages/graphiql/vite.config.mts * merge * add changeset * yarn.lock --------- Co-authored-by: Ted Thibodeau Jr <[email protected]> * [3] remove unused webpack deps (#3681) * new looks of tabs * add graphiql react too * all fixes * more polishing * more * more * more * more * more * prettier * polish changeset * disable shrinking while changing the operation name * Update packages/graphiql-react/src/ui/tabs.css Co-authored-by: Ted Thibodeau Jr <[email protected]> * yarn i * apply new design changes * prettier * vite more more more * fix demo * fix cspell * fix dev * update cypress to v13 * upd cache key * remove webpack deps * fix `yarn jest --coverage` * Update .changeset/thirty-spoons-call.md * Update packages/graphiql/vite.config.mts * merge * add changeset * yarn.lock * yarn.lock --------- Co-authored-by: Ted Thibodeau Jr <[email protected]> * [4] update graphql to `16.9.0` and use vite `define` configuration to remove development code from cdn bundle (#3683) * vite more more more * fix demo * fix cspell * fix dev * update cypress to v13 * upd cache key * remove webpack deps * fix `yarn jest --coverage` * upd graphql * aa * yarn.lock * fix tests * remove `data-testid="graphiql-container"` (#3688) * commit `pre.json` until `graphiql-v4` will be added to list of authorized branches to deploy * remove `graphiql-v4` from release.yml * [v4] remove `disableTabs` option (#3687) * remove `disableTabs` option * format * commit `pre.json` * add `graphiql-v4` in release.yml * [v4] prefer `location` over `window.location` and prefer `navigator` over `window.navigator` (#3692) * [v4] remove `build.sh` and `checkgit.sh` (#3694) * [v4] test umd build only on ci, locally test cdn.ts (#3693) * test umd build only on ci, locally test cdn.ts * Update custom-words.txt * [v4] convert graphiql e2e server to ESM (#3697) * aa * fix netlify * fix * fix fails on ci * [v4] update changeset for changed exports (#3700) * [v4] generate types with `vite-plugin-dts` (#3702) * generate types with `vite-plugin-dts` * add types:check in prebuild * more * more * more * update vite * upd * use terser * [v4] use `vite build --watch` instead of `vite` for `dev` script because we don't need development server for them (#3705) * [v4] remove graphiql default export (#3706) * aa * aa * polish * [v4] fix netlify deploy (#3708) * fix netlify deploy * fix cypress * change `style.css` imports (#3709) * Update poor-ghosts-jump.md * Version Packages (alpha) (#3689) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * [v4] show tabs even there is only 1 tab (#3713) * aa * aa * fix unit tests * fix cypress * [v4] Remove `toolbar.additionalContent` and `toolbar.additionalComponent` props in favor of `GraphiQL.Toolbar` render props. (#3707) * Version Packages (alpha) (#3714) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * [v4] use `position: absolute` for `.graphiql-logo` class (#3716) * [v4] remove `createComponentGroup` utility in favour `Object.assign` (#3717) * Version Packages (alpha) (#3718) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * [v4] fix merge conflicts with `main` (#3719) * upgrade to graphql v17 including support for new incremental delivery format (#3682) * add support for new incremental delivery format * fix vitest * add patch for graphql-js bug submittes upstream with test at graphql/graphql-js#4160 * apply feedback * move patches! * some fixes * fix netlify/cypress * remove export * update changeset --------- Co-authored-by: Dimitri POSTOLOV <[email protected]> * Version Packages (#3715) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * prettier * fix e2e * update pr-graphql-compat-check.yml * prettier --------- Co-authored-by: Yaacov Rydzinski <[email protected]> Co-authored-by: Rikki Schulte <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * [v4] fix scrollbar appearing in sidebar (#3720) * replace `overflow-y: scroll` with `overflow-y: auto` * fix netlify graphql function * Version Packages (alpha) (#3723) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * style: Don't convert single \n to <br> (#3414) * Update development instructions * Don't convert single \n to <br> * Add changeset * Update .changeset/olive-mice-hide.md --------- Co-authored-by: Dimitri POSTOLOV <[email protected]> * [v4] some refactoring (#3726) * some refactoring * use `right: var(--px-16)` instead of `right: 0` for `.graphiql-logo` * more * try to fix * fix join is not defined * Update packages/graphiql/cypress/e2e/incremental-delivery.cy.ts Co-authored-by: Ted Thibodeau Jr <[email protected]> --------- Co-authored-by: Ted Thibodeau Jr <[email protected]> * [v4] polish `tabs.cy` tests, remove `.graphiql-session` class (#3728) * aa * aa * aa * aa * fix tests * [v4] rollback `position: absolute` style for `.graphiql-logo` because tabs will behind logo (#3730) * Version Packages (alpha) (#3725) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Add support for onPrettifyQuery callback to enable customised query formatting (#3733) * aa * prettifyyy * Version Packages (alpha) (#3732) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * aa * aa * Apply suggestions from code review Co-authored-by: Ted Thibodeau Jr <[email protected]> * upd * upd * Delete .changeset/breezy-chicken-crash.md * Delete .changeset/add-on-prettify-callback.md * Delete .changeset/few-steaks-clap.md * Delete .changeset/flat-lies-heal.md * Delete .changeset/gentle-bugs-mix.md * Delete .changeset/green-pugs-worry.md * Delete .changeset/good-vans-refuse.md * Delete .changeset/metal-glasses-bow.md * Delete .changeset/hungry-spiders-cheat.md * Delete .changeset/old-zebras-knock.md * Delete .changeset/orange-rivers-draw.md * Delete .changeset/olive-mice-hide.md * Delete .changeset/pink-moose-shake.md * Delete .changeset/poor-ghosts-jump.md * Delete .changeset/red-papayas-fly.md * Delete .changeset/rich-jobs-kick.md * Delete .changeset/serious-forks-sip.md * Delete .changeset/strong-ears-bake.md * Delete .changeset/spotty-bulldogs-confess.md * Delete .changeset/thick-adults-leave.md * Delete .changeset/weak-dancers-jog.md * Delete .changeset/wicked-seas-laugh.md * Delete .changeset/thirty-spoons-call.md * Update .changeset/nasty-cows-train.md * Update resources/custom-words.txt * rollback * rollback * rollback * upd * upd * upd * upd * upd * upd * upd * prettier * upd * upd * upd * upd * upd * upd * upd * upd * try isMounted * Update packages/graphiql/cypress/e2e/headers.cy.ts * Update packages/graphiql/src/e2e.ts * fix tabs tests * try * improve use did update * upd * upd changeset * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd error message and changeset * Update packages/graphiql/src/GraphiQL.spec.tsx * Update packages/graphiql/src/GraphiQL.spec.tsx * improve tsdoc comment --------- Co-authored-by: Ted Thibodeau Jr <[email protected]> Co-authored-by: Rikki Schulte <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Yaacov Rydzinski <[email protected]> Co-authored-by: Leonard Ehrenfried <[email protected]> * Version Packages (rc) (#4028) * Version Packages (rc) * run yarn --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> * graphiql 5: improve migration guide (#4029) * improve migration guide * upd * upd * upd * upd * upd * prettier * upd * upd * upd * upd * upd * upd * prettier * exit changeset * Version Packages (#4030) * Version Packages * run yarn * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dimitri POSTOLOV <[email protected]> --------- Co-authored-by: Rikki Schulte <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ted Thibodeau Jr <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Yaacov Rydzinski <[email protected]> Co-authored-by: Leonard Ehrenfried <[email protected]>
1 parent a862358 commit d17b546

File tree

286 files changed

+8272
-6751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+8272
-6751
lines changed

.changeset/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"access": "public",
77
"baseBranch": "main",
88
"ignore": [
9+
"example-graphiql-vite",
910
"example-graphiql-webpack",
1011
"example-monaco-graphql-nextjs",
1112
"example-monaco-graphql-react-vite",

.eslintrc.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ module.exports = {
3232
'functions/*',
3333
'packages/vscode-graphql-syntax/tests/__fixtures__/*',
3434
// symlinks
35+
'packages/graphiql-react/__mocks__/monaco-editor.ts',
3536
'packages/graphiql-plugin-doc-explorer/__mocks__/zustand.ts',
37+
'packages/graphiql-plugin-doc-explorer/__mocks__/monaco-editor.ts',
3638
'packages/graphiql-plugin-history/__mocks__/zustand.ts',
39+
'packages/graphiql-plugin-history/__mocks__/monaco-editor.ts',
3740
],
3841
overrides: [
3942
{
@@ -142,6 +145,15 @@ module.exports = {
142145
property: 'navigator',
143146
message: 'Use `navigator` instead',
144147
},
148+
{
149+
object: 'window',
150+
property: 'getComputedStyle',
151+
message: 'Use `getComputedStyle` instead',
152+
},
153+
{
154+
object: 'self',
155+
message: 'Use `globalThis` instead',
156+
},
145157
],
146158
'no-return-assign': 'error',
147159
'no-return-await': 'error',
@@ -171,7 +183,7 @@ module.exports = {
171183
'init-declarations': 'off',
172184
'no-catch-shadow': 'error',
173185
'no-label-var': 'error',
174-
'no-restricted-globals': 'off',
186+
'no-restricted-globals': ['error', 'stop'],
175187
'no-shadow': 'off',
176188
'@typescript-eslint/no-shadow': 'error',
177189
'no-undef-init': 'off',
@@ -362,6 +374,7 @@ module.exports = {
362374
'unicorn/no-length-as-slice-end': 'error',
363375
'unicorn/prefer-string-replace-all': 'error',
364376
'unicorn/prefer-array-some': 'error',
377+
// '@typescript-eslint/prefer-for-of': 'error', TODO
365378
'unicorn/no-hex-escape': 'off', // TODO: enable
366379
// doesn't catch a lot of cases; we use ESLint builtin `no-restricted-syntax` to forbid `.keyCode`
367380
'unicorn/prefer-keyboard-event-key': 'off',
@@ -374,6 +387,13 @@ module.exports = {
374387
'import-x/no-named-as-default-member': 'off',
375388
},
376389
},
390+
{
391+
files: ['packages/{monaco-graphql,graphiql*}/**/*.{ts,tsx,mts,cts}'],
392+
excludedFiles: ['packages/graphiql-toolkit/**/*.{ts,tsx}'],
393+
rules: {
394+
'@typescript-eslint/no-unnecessary-condition': 'error',
395+
},
396+
},
377397
{
378398
// Rules that requires type information
379399
files: ['**/*.{ts,tsx,mts,cts}'],
@@ -388,6 +408,7 @@ module.exports = {
388408
'@typescript-eslint/consistent-type-assertions': 'error',
389409
'@typescript-eslint/no-duplicate-type-constituents': 'error',
390410
'@typescript-eslint/no-unnecessary-type-conversion': 'error',
411+
// '@typescript-eslint/await-thenable': 'error', // TODO
391412
// TODO: Fix all errors for the following rules included in recommended config
392413
'@typescript-eslint/no-deprecated': 'off',
393414
'@typescript-eslint/no-unsafe-function-type': 'off',
@@ -404,11 +425,10 @@ module.exports = {
404425
projectService: {
405426
allowDefaultProject: [
406427
'examples/monaco-graphql-react-vite/vite.config.ts',
407-
'packages/graphiql/vite.config.mts',
408-
'packages/{codemirror-graphql,graphiql-toolkit,graphql-language-service-cli,graphql-language-service,monaco-graphql,vscode-graphql-syntax,graphiql}/vitest.config.mts',
428+
'packages/{codemirror-graphql,graphiql-toolkit,graphql-language-service-cli,graphql-language-service,monaco-graphql,vscode-graphql-syntax}/vitest.config.mts',
409429

410430
'packages/cm6-graphql/__tests__/test.spec.ts',
411-
'packages/graphiql/src/GraphiQL.spec.tsx',
431+
'packages/graphiql/cypress.config.ts',
412432
'packages/vscode-graphql-syntax/tests/*.spec.ts',
413433
'packages/graphql-language-service-cli/src/__tests__/*.test.ts',
414434
'packages/monaco-graphql/test/monaco-editor.test.ts',
@@ -565,6 +585,7 @@ module.exports = {
565585
'react-hooks/rules-of-hooks': 'off',
566586
'sonarjs/no-dead-store': 'off',
567587
'@typescript-eslint/no-restricted-imports': 'off',
588+
'@typescript-eslint/no-unnecessary-condition': 'off',
568589
},
569590
},
570591
],

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Release
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, graphiql-5]
66
permissions: {}
77
jobs:
88
release:

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ packages/codemirror-graphql/*.d.ts
4646
packages/codemirror-graphql/*.map
4747
!packages/codemirror-graphql/*.config.js
4848

49-
packages/graphiql/graphiql*.js
50-
packages/graphiql/*.css
51-
packages/graphiql/*.map
5249
packages/graphiql/cypress/screenshots/
50+
packages/graphiql/cypress/downloads/
51+
packages/graphiql/cypress/videos/
5352
packages/graphiql/typedoc/
5453
packages/graphiql/webpack/
55-
56-
packages/graphiql/cypress/downloads/

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"**/esbuild.js",
2020
".eslintrc.js",
2121
".vscode/extensions.json",
22+
"packages/monaco-graphql/test/monaco-editor.test.ts",
2223
"working-group"
2324
],
2425
"files": ["**/*.{js,cjs,mjs,ts,jsx,tsx,md,mdx,html,json,css,toml,yaml,yml}"]

docs/migration/graphiql-5.0.0.md

Lines changed: 191 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,199 @@
1-
# Upgrading `graphiql` from `4.x` to `5.0.0-rc`
1+
# Upgrading `graphiql` from `4.x` to `5.0.0`
2+
3+
Starting from GraphiQL 5, you need to set up Monaco workers in your project:
4+
5+
- For **Vite** projects you must import:
6+
7+
```js
8+
import 'graphiql/setup-workers/vite';
9+
```
10+
11+
> [!NOTE]
12+
>
13+
> See [Vite example](../../examples/graphiql-vite/src/App.jsx).
14+
15+
- For Webpack projects such as **Next.js** you must import:
16+
17+
```js
18+
import 'graphiql/setup-workers/webpack';
19+
```
20+
21+
> [!NOTE]
22+
>
23+
> See [Next.js example](../../examples/graphiql-nextjs/src/app/page.tsx).
24+
25+
- For ESM-based CDN usages, you must use
26+
[`?worker` query](https://esm.sh/#web-worker) to load the module as a web
27+
worker:
28+
29+
```js
30+
import createJSONWorker from 'https://esm.sh/monaco-editor/esm/vs/language/json/json.worker.js?worker';
31+
import createGraphQLWorker from 'https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker';
32+
import createEditorWorker from 'https://esm.sh/monaco-editor/esm/vs/editor/editor.worker.js?worker';
33+
34+
globalThis.MonacoEnvironment = {
35+
getWorker(_workerId, label) {
36+
switch (label) {
37+
case 'json':
38+
return createJSONWorker();
39+
case 'graphql':
40+
return createGraphQLWorker();
41+
}
42+
return createEditorWorker();
43+
},
44+
};
45+
```
46+
47+
> [!NOTE]
48+
>
49+
> See [CDN example](../../examples/graphiql-cdn/index.html).
50+
51+
## Allow to Override All Default GraphiQL Plugins
52+
53+
Starting from GraphiQL 5, you can override all default plugins.
54+
55+
### Removing All Default Plugins
56+
57+
To remove all default plugins (currently **Doc Explorer** and **History**), set
58+
`referencePlugin={null}` and pass an empty array to the `plugins` prop:
59+
60+
```jsx
61+
import { GraphiQL } from 'graphiql';
62+
63+
const myPlugins = [];
64+
65+
function App() {
66+
return (
67+
<GraphiQL
68+
referencePlugin={null} // Removes Doc Explorer plugin
69+
plugins={myPlugins} // Removes History plugin
70+
/>
71+
);
72+
}
73+
```
74+
75+
> [!NOTE]
76+
>
77+
> If you're using a custom Doc Explorer, pass it to the `referencePlugin` prop —
78+
> **not** the `plugins` array. It will be automatically included and always
79+
> rendered first.
80+
81+
### Adding Plugins While Keeping Defaults
82+
83+
If you're adding custom plugins (e.g., the **Explorer** plugin) and want to keep
84+
the **History** plugin, you must explicitly include it in the `plugins` array:
85+
86+
```jsx
87+
import { GraphiQL, HISTORY_PLUGIN } from 'graphiql';
88+
import { explorerPlugin } from '@graphiql/plugin-explorer';
89+
90+
const myPlugins = [HISTORY_PLUGIN, explorerPlugin()];
91+
92+
function App() {
93+
return <GraphiQL plugins={myPlugins} />;
94+
}
95+
```
296

397
---
498

599
## `graphiql`
6100

7-
- Migration from Codemirror to
8-
[Monaco Editor](https://github.com/microsoft/monaco-editor)
9-
- Replacing `codemirror-graphql` with
10-
[`monaco-graphql`](https://github.com/graphql/graphiql/tree/main/packages/monaco-graphql)
101+
> [!WARNING]
102+
>
103+
> ⚠️ UMD build is removed. Switch to the [ESM CDN example](../../examples/graphiql-cdn/index.html).
104+
105+
- Migration from Codemirror to [Monaco Editor](https://github.com/microsoft/monaco-editor)
106+
- Replacing `codemirror-graphql` with [`monaco-graphql`](../../packages/monaco-graphql)
11107
- Clicking on a reference in the query editor now works by holding `Cmd` on macOS or `Ctrl` on Windows/Linux
12108
- Support for comments in **Variables** and **Headers** editors
13-
- Added new examples: [**GraphiQL x Vite**](https://github.com/graphql/graphiql/tree/graphiql-5/examples/graphiql-vite) and [**GraphiQL x
14-
Next.js**](https://github.com/graphql/graphiql/tree/graphiql-5/examples/graphiql-nextjs)
109+
- Added new examples: [**GraphiQL x Vite**](../../examples/graphiql-vite) and [**GraphiQL x Next.js**](../../examples/graphiql-nextjs)
15110
- Removed examples: **GraphiQL x Parcel** and **GraphiQL x Create React App**
111+
- Removed props
112+
- `query`
113+
- `variables`
114+
- `headers`
115+
- `response`
116+
- `readOnly`
117+
- `keyMap`. To use Vim or Emacs keybindings in Monaco, you can use community plugins. Monaco Vim: https://github.com/brijeshb42/monaco-vim. Monaco Emacs: https://github.com/aioutecism/monaco-emacs
118+
- `validationRules`. Use custom GraphQL worker, see https://github.com/graphql/graphiql/tree/main/packages/monaco-graphql#custom-webworker-for-passing-non-static-config-to-worker.'
119+
120+
> [!NOTE]
121+
>
122+
> If you used `query`, `variables` and `headers` in integration tests, you can use the new `initialQuery`,
123+
> `initialVariables` and `initialHeaders` props instead. These props will only be used for the first tab.
124+
> When opening more tabs, the query editor will start out empty.
125+
126+
- Added new props
127+
- `initialQuery`
128+
- `initialVariables`
129+
- `initialHeaders`
130+
- feat: allow `children: ReactNode` for `<GraphiQL.Toolbar />` component
131+
132+
---
133+
134+
## `@graphiql/react`
135+
136+
> [!IMPORTANT]
137+
>
138+
> Clicking on a reference in the Query editor now works by holding `Cmd` on macOS or `Ctrl` on Windows/Linux.
139+
140+
- `usePrettifyEditors`, `useCopyQuery`, `useMergeQuery`, `useExecutionContext`, `usePluginContext`, `useSchemaContext`, `useStorageContext` hooks are deprecated.
141+
- Add new `useGraphiQL` and `useGraphiQLActions` hooks instead. See updated [README](../../packages/graphiql-react/README.md#available-stores) for more details about them.
142+
- remove `useSynchronizeValue` hook
143+
- fix `defaultQuery` with empty string does not result in an empty default query
144+
- fix `defaultQuery`, when is set will only be used for the first tab. When opening more tabs, the query editor will start out empty
145+
- fix execute query shortcut in query editor, run it even there are no operations in query editor
146+
- fix plugin store, save last opened plugin in storage
147+
- remove `onClickReference` from variable editor
148+
- fix shortcut text per OS for default query and in run query in execute query button's tooltip
149+
150+
The `ToolbarMenu` component has changed.
151+
152+
- The `label` and `className` props were removed
153+
- The `button` prop should now be a button element
154+
155+
```jsx
156+
<ToolbarMenu
157+
label="Options"
158+
button={
159+
<ToolbarButton label="Options">
160+
<SettingsIcon className="graphiql-toolbar-icon" aria-hidden="true" />
161+
</ToolbarButton>
162+
}
163+
>
164+
<ToolbarMenu.Item onSelect={() => console.log('Clicked!')}>
165+
Test
166+
</ToolbarMenu.Item>
167+
</ToolbarMenu>
168+
```
169+
170+
## `@graphiql/plugin-code-exporter`
171+
172+
> [!WARNING]
173+
>
174+
> ⚠️ UMD build is removed. Switch to the [ESM CDN example](../../packages/graphiql-plugin-code-exporter/example/index.html).
175+
176+
---
177+
178+
## `@graphiql/plugin-explorer`
179+
180+
> [!WARNING]
181+
>
182+
> ⚠️ UMD build is removed. Switch to the [ESM CDN example](../../examples/graphiql-cdn/index.html).
183+
184+
---
185+
186+
## @graphiql/plugin-doc-explorer
187+
188+
- `useExplorerContext` hook is deprecated. Use new `useDocExplorer` and `useDocExplorerActions` hooks instead.
189+
- The shortcut to focus on the Doc Explorer search input is now `Cmd/Ctrl+Alt+K`
190+
instead of the previous `Cmd/Ctrl+K`. This was changed because monaco-editor has
191+
a built-in `Cmd/Ctrl+K` command.
192+
- push a field type on stack too before field
193+
- fix: show spinner in doc explorer based on `isIntrospecting` value, and not based on `isFetching`
194+
195+
---
196+
197+
## @graphiql/plugin-history
198+
199+
- `useHistoryContext` hook is deprecated. Use new `useHistory` and `useHistoryActions` hooks instead.

0 commit comments

Comments
 (0)