{"name":"graphiql","version":"5.3.0","license":"MIT","_id":"graphiql@5.3.0","maintainers":[{"name":"benjie","email":"npm@benjiegillam.com"},{"name":"mjmahone","email":"mahoney.mattj@gmail.com"},{"name":"leebyron","email":"lee@leebyron.com"},{"name":"i1g","email":"ivan.goncharov.ua@gmail.com"},{"name":"acao","email":"rikki.schulte@gmail.com"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"kassens","email":"jkassens@fb.com"},{"name":"orta","email":"orta.therox@gmail.com"},{"name":"asiandrummer","email":"asiandrummer@gmail.com"},{"name":"thomasheyenbrock","email":"thomas.heyenbrock@gmail.com"},{"name":"ags-","email":"agomezs@fb.com"}],"contributors":[{"url":"https://dimaMachina.com","name":"Dimitri POSTOLOV","email":"dmytropostolov@gmail.com"},{"name":"Hyohyeon Jeong","email":"asiandrummer@fb.com"},{"url":"https://leebyron.com","name":"Lee Byron","email":"lee@leebyron.com"}],"homepage":"https://github.com/graphql/graphiql/tree/master/packages/graphiql#readme","bugs":{"url":"https://github.com/graphql/graphiql/issues?q=issue+label:graphiql"},"dist":{"shasum":"a0bf99e679522a53579d3d0ef0a39813cacec5e5","tarball":"http://registry-npm.ywwl.com/graphiql/download/graphiql-5.3.0.tgz","fileCount":37,"integrity":"sha512-HTEBbLjONUnz7Epenaq7xjPxZygVY5mR6ULSUO0Luq0fDaOoYhwKk8G1De8ccQQI21lzMH26B7lq+hXb28c1Ng==","signatures":[{"sig":"MEUCIByn1wNyhtV6ZdcBiRFxiI3rCAkZiQ6Dr6k826yR7FwRAiEAjSJ+2n5N9Pv21+5Ot7gG1jtFP8hgNZLZh48LtAp2auM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCICVhuc1KwDv3src9mbQfv7CgNqms9Tskg4Jilh4M/mhoAiAJQyQuwz1FujhEf7OAefLpKXW489PBpSRrOmr1L6rsJg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/graphiql@5.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1021095,"size":468258,"noattachment":false,"key":"/graphiql/-/graphiql-5.3.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","browser":{"//":"esm.sh polyfills `process`, we don't need it","process":false},"exports":{".":"./dist/index.js","./style.css":"./dist/style.css","./graphiql.css":"./dist/graphiql.css","./package.json":"./package.json","./setup-workers/*":{"types":"./dist/setup-workers/*.d.ts","import":"./dist/setup-workers/*.js"}},"gitHead":"7d543a9d8c71cac4a674c999e7a94b60236a146d","scripts":{"dev":"concurrently 'cross-env PORT=8080 node test/e2e-server' vite","e2e":"yarn e2e-server 'cypress run'","test":"vitest run","build":"vite build && UMD=true vite build","e2e-server":"start-server-and-test 'cross-env PORT=8080 node test/e2e-server' 'http-get://localhost:8080/graphql?query={test { id }}'","types:check":"tsgo --noEmit","cypress-open":"cypress open --browser electron"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:85636219-244d-4b4d-8647-6f8b41b029fa"}},"repository":{"url":"git+https://github.com/graphql/graphiql.git","type":"git","directory":"packages/graphiql"},"_npmVersion":"11.17.0","description":"An graphical interactive in-browser GraphQL IDE.","directories":{},"sideEffects":["dist/setup-workers/*","*.css"],"_nodeVersion":"24.19.0","dependencies":{"@graphiql/react":"^0.38.0","react-compiler-runtime":"19.1.0-rc.1","@graphiql/plugin-history":"^0.4.3","@graphiql/plugin-doc-explorer":"^0.4.3"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.4.3","react":"^19.1.0","cypress":"^13.13.2","graphql":"^16.11.0","cross-env":"^7.0.2","react-dom":"^19.1.0","typescript":"^5.8.0","concurrently":"^7.0.0","lightningcss":"^1.29.3","vite-plugin-dts":"^4.5.3","@graphiql/toolkit":"^0.12.1","@vitest/web-worker":"^4.1.6","vitest-canvas-mock":"^1.1.4","@testing-library/dom":"^10.4.0","@vitejs/plugin-react":"^4.4.1","start-server-and-test":"^1.10.11","@testing-library/react":"^16.3.0","@testing-library/jest-dom":"^6.6.3","babel-plugin-react-compiler":"19.1.0-rc.3"},"peerDependencies":{"react":"^18 || ^19","graphql":"^15.5.0 || ^16.0.0 || ^17.0.0","react-dom":"^18 || ^19"},"_npmOperationalInternal":{"tmp":"tmp/graphiql_5.3.0_1787661541697_0.0982929153214378","host":"s3://npm-registry-packages-npm-production"},"readme":"# GraphiQL\n\n> **Security Notice:** All versions of `graphiql` < `1.4.3` are vulnerable to an\n> XSS attack in cases where the GraphQL server to which the GraphiQL web app\n> connects is not trusted. Learn more in\n> [our security advisory](https://github.com/graphql/graphiql/tree/main/docs/security/2021-introspection-schema-xss.md).\n\n[![NPM](https://img.shields.io/npm/v/graphiql.svg)](https://npmjs.com/graphiql)\n![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/graphiql)\n![npm downloads](https://img.shields.io/npm/dm/graphiql?label=npm%20downloads)\n![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/graphiql)\n![npm bundle size (version)](https://img.shields.io/bundlephobia/min/graphiql/latest)\n![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/graphiql/latest)\n[![License](https://img.shields.io/npm/l/graphiql.svg?style=flat-square)](LICENSE)\n[![](https://dcbadge.vercel.app/api/server/NP5vbPeUFp?style=flat)](https://discord.gg/NP5vbPeUFp)\n\n_/ˈɡrafək(ə)l/_ A graphical interactive in-browser GraphQL IDE.\n[Try the live demo](https://graphql.org/swapi-graphql).\n\n[![](resources/graphiql.png)](https://graphql.org/swapi-graphql)\n\n## Features\n\n- Full language support of the latest\n  [GraphQL Specification](https://spec.graphql.org/draft/#sec-Language):\n- Syntax highlighting\n- Intelligent type ahead of fields, arguments, types, and more\n- Real-time error highlighting and reporting for queries and variables\n- Automatic query and variables completion\n- Automatic leaf node insertion for non-scalar fields\n- Documentation explorer with search and markdown support\n- Persisted state using `localStorage`\n- Simple API for adding custom plugins\n\n## Live Demos\n\n- The [latest stable version](https://graphql.org/swapi-graphql)\n- The current state of the `main` branch:\n  - An [installable PWA](https://graphiql-test.netlify.com/webpack) with plugins ([source](../../examples//graphiql-webpack))\n  - Using the [minified bundles](https://graphiql-test.netlify.com)\n  - Using the [development bundles](https://graphiql-test.netlify.com/dev) (good\n    for inspecting, debugging, etc)\n- Each pull request will also get its own preview deployment on Netlify, you'll\n  find a link in the GitHub checks\n\n## Examples\n\n- [`CDN`](../../examples/graphiql-cdn) - A single HTML file that loads GraphiQL directly from a CDN\n- [`Webpack`](../../examples/graphiql-webpack) - A starter for Webpack\n- [`Create React App`](../../examples/graphiql-create-react-app) - An example\n  using [Create React App](https://create-react-app.dev)\n- [`Parcel`](../../examples/graphiql-parcel) - An example using\n  [Parcel](https://parceljs.org)\n\n## Getting started\n\n- [Migration guide to GraphiQL 2](../../docs/migration/graphiql-2.0.0.md)\n- [Migration guide to GraphiQL 4](../../docs/migration/graphiql-4.0.0.md)\n- [Migration guide to GraphiQL 5](../../docs/migration/graphiql-5.0.0.md)\n- [Migration guide to GraphiQL 6](../../docs/migration/graphiql-6.0.0.md)\n\n### CDN usage\n\nTo use GraphiQL without a bundler, follow the [CDN example](../../examples/graphiql-cdn).\n\n## Usage\n\n### Using as package\n\nThe `graphiql` package can be installed using your favorite package manager. You\nalso need to have `react`,`react-dom` and `graphql` installed which are peer\ndependencies of `graphiql`.\n\n```sh\nnpm install graphiql react react-dom graphql\n```\n\nThe package exports a bunch of React components:\n\n- The `GraphiQLProvider` components renders multiple context providers that\n  encapsulate all state management\n- The `GraphiQLInterface` component renders the UI that makes up GraphiQL\n- The `GraphiQL` component is a combination of both the above components\n\nThe `GraphiQL` component needs to know how to run operations against a GraphQL\nAPI, which it gets from either a `transport` or a `fetcher` prop (the two are\nmutually exclusive). A `transport` is an object with a `send(request)` method\nthat performs the request. `send` may return a `Promise` for queries or\nmutations, or an `AsyncIterable` for subscriptions and multipart responses.\n\nAn easy way to create one is the\n[`createTransport`](../graphiql-toolkit/src/create-transport/createTransport.ts)\nfunction exported from the `@graphiql/toolkit` package. If you want to\nimplement your own transport, you can use the `Transport` type from\n`@graphiql/toolkit` to make sure the shape matches what GraphiQL expects.\n\n`fetcher` is still supported — it's deprecated but not removed, and predates\n`transport`. Unlike a `transport`, a `fetcher` is a plain function that returns\nan execution result directly, with no access to the underlying HTTP response.\nSee the [v6 migration guide](../../docs/migration/graphiql-6.0.0.md#new-transport-api)\nif you're moving from `fetcher` to `transport`.\n\nThe following is everything you need to render GraphiQL in your React\napplication:\n\n```jsx\nimport { createTransport } from '@graphiql/toolkit';\nimport { GraphiQL } from 'graphiql';\nimport { createRoot } from 'react-dom/client';\nimport 'graphiql/style.css';\n\nconst transport = createTransport({ url: 'https://my.backend/graphql' });\n\nconst root = createRoot(document.getElementById('root'));\nroot.render(<GraphiQL transport={transport} />);\n```\n\nWhen the connected server supports GraphQL.js 17 fragment arguments, opt in\nwith `<GraphiQL fetcher={fetcher} experimentalFragmentArguments />`. The syntax\nis disabled by default.\n\n## Customize\n\nGraphiQL supports customization in UI and behavior by accepting React props and\nchildren.\n\n### Props\n\nFor props documentation, see the\n[API Docs](https://graphiql-test.netlify.app/typedoc/modules/graphiql.html#graphiqlprops-1)\n\n### Children\n\nParts of the UI can be customized by passing children to the `GraphiQL` or the\n`GraphiQLInterface` component.\n\n- `<GraphiQL.Footer>`: Add a custom footer shown below the response editor.\n\nBranding and toolbar customization moved off the children API in `graphiql@6`:\n\n- Replace the top bar's default hexagon icon + \"GraphiQL\" wordmark with the\n  `brand` prop, e.g. `<GraphiQL brand=\"My Company\" />`.\n- Add custom toolbar buttons through a plugin's `sessionActions`, which renders\n  into the tab strip alongside prettify/merge/copy/save. See the\n  [v6 migration guide](../../docs/migration/graphiql-6.0.0.md) for details.\n\n### Plugins\n\nStarting with `graphiql@2` there exists a simple plugin API that allows you to\nbuild your own custom tools right into GraphiQL.\n\nGraphiQL includes the History, Query Builder, and Collections plugins by\ndefault. The documentation explorer is the default reference plugin. These can\nbe toggled using icons in the sidebar on the left side of the screen. When\nopened, they appear next to the sidebar in a resizable portion of the screen.\n\nTo define your own plugin, all you need is a JavaScript object with three\nproperties:\n\n- `title`: A unique title for the plugin (this will show up in a tooltip when\n  hovering over the sidebar icon)\n- `icon`: A React component that renders an icon which will be included in the\n  sidebar\n- `content`: A React component that renders the plugin contents which will be\n  shown next to the sidebar when opening the plugin\n\nYou can pass a list of plugin objects to the `GraphiQL` component using the\n`plugins` prop. Doing so replaces the default list. Start with the immutable\n`DEFAULT_PLUGINS` export when adding or removing a plugin so you don't need to\nimport the built-in plugin packages directly:\n\n```jsx\nimport { DEFAULT_PLUGINS, GraphiQL } from 'graphiql';\n\nconst plugins = [...DEFAULT_PLUGINS, myPlugin];\n\n<GraphiQL plugins={plugins} transport={transport} />;\n```\n\nYou can also control the visibility state of plugins using the `visiblePlugin`\nprop and react to changes of the plugin visibility state using the\n`onTogglePluginVisibility` prop.\n\nInside the component you pass to `content` you can interact with the GraphiQL\nstate using the hooks provided by `@graphiql/react`.\n\n### Theming\n\nThe GraphiQL interface uses CSS variables for theming, in particular for colors.\nAs of v6 the supported set is the OKLCH design tokens in\n[`tokens.css`](../graphiql-react/src/style/tokens.css); the older `--color-*` HSL\nvariables in [`root.css`](../graphiql-react/src/style/root.css) are deprecated\n(see the [v6 migration guide](../../docs/migration/graphiql-6.0.0.md#css-and-retheming)).\n\nOverriding these variables is the only officially supported way of customizing\nthe appearance of GraphiQL. Starting from version 2, class names are no longer\nbe considered stable and might change between minor or patch version updates.\n\n### Editor Theme\n\nThe query, variables, headers, and response editors are built on\n[Monaco](https://microsoft.github.io/monaco-editor/), so editor theming goes\nthrough Monaco's theme system, not CSS. The `editorTheme` prop takes a\n`{ dark, light }` pair of Monaco theme names, one for each GraphiQL theme:\n\n```jsx\n<GraphiQL editorTheme={{ dark: 'graphiql-DARK', light: 'graphiql-LIGHT' }} />\n```\n\n`graphiql-DARK` and `graphiql-LIGHT` are the built-in themes and also the\ndefault value, so you only need to pass `editorTheme` if you want something\nelse. To use your own colors, register a theme with Monaco's `editor.defineTheme`\nAPI before rendering `GraphiQL`, then reference it by name:\n\n```jsx\nimport * as monaco from 'monaco-editor';\n\nmonaco.editor.defineTheme('my-dark-theme', {\n  base: 'vs-dark',\n  inherit: true,\n  rules: [],\n  colors: {},\n});\n\n// When rendering GraphiQL:\n<GraphiQL editorTheme={{ dark: 'my-dark-theme', light: 'graphiql-LIGHT' }} />;\n```\n\n## Usage with a Custom Storage Namespace\n\nWhen multiple GraphiQL instances run on the same origin—such as in different apps or\nenvironments—they can conflict by reading from and writing to the same `localStorage` keys. To\nprevent this, you can provide a custom `storage` object that prefixes all keys with a unique\nnamespace, isolating each instance’s state and avoiding collisions.\n\n```tsx\nimport type { FC } from 'react';\nimport { GraphiQL } from 'graphiql';\nimport { createTransport } from '@graphiql/toolkit';\n\nconst transport = createTransport({ url: 'https://my.backend/graphql' });\n\nconst NAMESPACE = 'my-namespace';\n\nconst storage: typeof localStorage = {\n  ...localStorage,\n  getItem(key) {\n    return localStorage.getItem(`${NAMESPACE}:${key}`);\n  },\n  setItem(key, value) {\n    return localStorage.setItem(`${NAMESPACE}:${key}`, value);\n  },\n  removeItem(key) {\n    return localStorage.removeItem(`${NAMESPACE}:${key}`);\n  },\n};\n\nexport const App: FC = () => {\n  return <GraphiQL transport={transport} storage={myStorage} />;\n};\n```\n","publish_time":1787661541806,"_cnpm_publish_time":1787661541806,"dist-tags":{"alpha":"5.2.4-alpha.0","beta":"6.0.0-beta.4","canary":"5.2.2-canary-67317292.0","latest":"6.0.0","next":"2.0.0-next.2","rc":"6.0.0-rc.3"}}