Aggiornare @graphiql/toolkit da 0.x a 1.x
Confronto dell’API pubblica di @graphiql/toolkit 0.12.1 e 1.0.0, calcolato automaticamente dai tipi TypeScript. Una firma modificata è una possibile modifica incompatibile, non una certezza.
Riepilogo
| Percorsi di import rimossi | 0 |
|---|---|
| Export rimossi | 0 |
| Firme modificate | 3 |
| Membri di classi o interfacce rimossi | 2 |
| Membri di classi o interfacce modificati | 2 |
| Nuove deprecazioni | 5 |
| Requisiti cambiati (engines, dipendenze peer) | 1 |
| Nuovi export | 9 |
Export rimossi
Nessuna rilevata.
Firme modificate
| export | Prima | Dopo |
|---|---|---|
@graphiql/toolkit · FetcherOpts | { headers?: { [key: string]: any; } | undefined; documentAST?: any; } | { headers?: { [key: string]: any; } | undefined; documentAST?: any; signal?: AbortSignal | undefined; } |
@graphiql/toolkit · FetcherParams | { query: string; operationName?: string | null | undefined; variables?: any; } | { query: string; operationName?: string | null | undefined; variables?: any; extensions?: Record<string, unknown> | undefined; } |
@graphiql/toolkit · QueryStoreItem | { query?: string | undefined; variables?: string | undefined; headers?: string | undefined; operationName?: string | undefined; label?: string | undefined; favorite?: boolean | undefined; } | { query?: string | undefined; variables?: string | undefined; headers?: string | undefined; operationName?: string | undefined; operation?: `${OperationTypeNode}` | undefined; label?: string | undefined; favorite?: boolean | undefined; } |
Membri di classi o interfacce rimossi
| member | import | Prima |
|---|---|---|
HistoryStore.shouldSaveQuery | @graphiql/toolkit | any |
CreateFetcherOptions.legacyClient | @graphiql/toolkit | any |
Membri di classi o interfacce modificati
| member | Prima | Dopo |
|---|---|---|
HistoryStore.editLabel | ({ query, variables, headers, operationName, label, favorite, }: QueryStoreItem, index?: number | undefined): void | ({ query, variables, headers, operationName, operation, label, favorite, }: QueryStoreItem, index?: number | undefined): void |
HistoryStore.toggleFavorite | ({ query, variables, headers, operationName, label, favorite, }: QueryStoreItem): void | ({ query, variables, headers, operationName, operation, label, favorite, }: QueryStoreItem): void |
Nuove deprecazioni
| export | @deprecated |
|---|---|
@graphiql/toolkit · Fetcher | Use `Transport` from `@graphiql/toolkit` instead. A `Transport` is an object with a `send(request)` method that returns a `TransportResponse` carrying the real HTTP wire data (status, headers, timing, size). See `docs/migration/graphiql-6.0.0.md`. |
@graphiql/toolkit · FetcherOpts | Use the `Transport` API from `@graphiql/toolkit` instead. See `docs/migration/graphiql-6.0.0.md`. |
@graphiql/toolkit · FetcherParams | Use the `Transport` API and `TransportRequest` from `@graphiql/toolkit` instead. See `docs/migration/graphiql-6.0.0.md`. |
@graphiql/toolkit · CreateFetcherOptions | Use `CreateTransportOptions` from `@graphiql/toolkit` instead. See `docs/migration/graphiql-6.0.0.md`. |
@graphiql/toolkit · createGraphiQLFetcher | Use `createTransport` from `@graphiql/toolkit` instead. The new API surfaces real response metadata (status, headers, timing, size) that the `Fetcher` contract cannot expose. See `docs/migration/graphiql-6.0.0.md`. |
Requisiti cambiati (engines, dipendenze peer)
| Prima | Dopo | |
|---|---|---|
peerDependencies.graphql | ^15.5.0 || ^16.0.0 || ^17.0.0 | ^16.11.0 || ^17.0.0 |
Nuovi export (9)
| import | export | kind |
|---|---|---|
@graphiql/toolkit | Operation | type |
@graphiql/toolkit | Transport | type |
@graphiql/toolkit | HttpMethod | type |
@graphiql/toolkit | createTransport | function |
@graphiql/toolkit | TransportRequest | type |
@graphiql/toolkit | TransportResponse | type |
@graphiql/toolkit | SubscriptionClient | type |
@graphiql/toolkit | SubscriptionRequest | type |
@graphiql/toolkit | CreateTransportOptions | type |
Changelog tra queste versioni
Testo pubblicato dagli autori del pacchetto, mostrato così com’è.
1.0.0
### Major Changes
- [#4478](https://github.com/graphql/graphiql/pull/4478) [`066528a`](https://github.com/graphql/graphiql/commit/066528a6bb7706d685536888d7b5549d6fd5a109) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - GraphQL.js 15 and 16.0–16.10 are no longer supported peer dependencies. The supported range is `^16.11.0 || ^17.0.0`. GraphQL.js 16.11 fixes OneOf input validation for nullable variables and tightens input-object coercion to reject arrays, giving GraphiQL 6 a correct baseline for OneOf inputs. Upgrade `graphql` before upgrading these packages.
- [#4392](https://github.com/graphql/graphiql/pull/4392) [`26ae143`](https://github.com/graphql/graphiql/commit/26ae143ba68004d4a50468ba1feb649ace673f3a) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Remove the deprecated `legacyClient` alias from `CreateFetcherOptions`. It duplicated `legacyWsClient` — pass `legacyWsClient` instead.
### Minor Changes
- [#4333](https://github.com/graphql/graphiql/pull/4333) [`093cb10`](https://github.com/graphql/graphiql/commit/093cb100a4524b1005b82c1c064bb897416bfc82) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Add `createTransport` and a structured `Transport` API for queries, mutations, subscriptions, and incremental delivery. Pass a transport through `<GraphiQL transport={...}>`; the `transport` and `fetcher` props are mutually exclusive at the type level.
`GraphiQLProps` is now a union. If a TypeScript wrapper uses `interface AppProps extends GraphiQLProps`, replace it with a type intersection such as `type AppProps = GraphiQLProps & { applicationName: string }`, even when retaining `fetcher`. See the [migration overview](https://github.com/graphql/graphiql/blob/c2e792bc446d5d6751bd7cd1d9ac283a4a1d8fc4/docs/migration/graphiql-6.0.0.md#overview).
When `supportedMethods` is omitted, `createTransport` discovers endpoint capabilities through `OPTIONS` and the `Allow` header. Queries prefer QUERY, then POST, then GET. Mutations and operations of unknown type require POST. An explicit `method` override applies to queries and fails if the endpoint excludes it. GET sends GraphQL parameters in the URL; POST and QUERY send a JSON body.
Discovery is shared by concurrent requests and repeats when effective request headers change. If discovery fails, exceeds two seconds, or the `Allow` header is missing or malformed, the transport assumes only its initially configured `method` (POST by default) is available. A valid advertisement containing no supported methods blocks execution. Pass a nonempty `supportedMethods` array to skip discovery for known capabilities. Cross-origin servers must permit OPTIONS and expose `Allow` through `Access-Control-Expose-Headers`.
`TransportResponse` exposes HTTP method, status, headers, timing, and byte sizes alongside the GraphQL result. HTTP metadata remains available when a response body is not valid JSON. Its `ok` field accounts for both HTTP status and GraphQL errors. `Tr1.0.0-rc.1
### Patch Changes
- [#4665](https://github.com/graphql/graphiql/pull/4665) [`c4a62af`](https://github.com/graphql/graphiql/commit/c4a62afd30d858c51da233b3f7c7283a35e4d5d2) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Discover HTTP methods automatically when `createTransport` is called without `supportedMethods`. Previous RCs treated an omitted `supportedMethods` as `['POST']` and exposed a method chip and switcher in the top bar. The transport now sends an OPTIONS request without a body before its first HTTP operation, reads `Allow`, and automatically selects QUERY, then POST, then GET for queries. The top bar method controls are removed. The response pane instead shows the actual request method from the optional `TransportResponse.method` field alongside timing and size, including for HTTP error responses and incremental chunks. WebSocket events and custom transports without this metadata omit the method.
Discovery uses the effective request headers, is shared by concurrent requests, and runs again when headers change. If OPTIONS fails, times out after two seconds, or returns no usable `Allow` header, execution falls back to POST (or the configured `method` override). A valid advertisement containing no usable methods blocks HTTP execution. Mutations always require POST; GraphiQL delegates routing to the transport from Run, the operation dropdown, and the keyboard shortcut. An operation whose type cannot be determined also requires POST. If POST is unavailable, these operations fail without sending.
Pass `method: 'GET'` to override automatic query selection for testing. GET encodes queries, operation names, variables, and extensions in the URL without a body; mutations still require POST. An override that discovery excludes fails without silently choosing another method. `transport.setMethod?.('GET')` changes the override for subsequent queries, and `transport.setMethod?.()` restores automatic selection. Pass `supportedMethods: ['POST']` to preserve the previous POST-only default and skip OPTIONS, or use `method: 'GET', supportedMethods: ['GET', 'POST']` to test GET queries and POST mutations without discovery. If discovery fails with a configured GET override and no explicit capabilities, only GET is assumed available.
For cross-origin discovery, the server must permit OPTIONS and expose `Allow` through `Access-Control-Expose-Headers`. This discovers methods only, not QUERY request formats through `Accept-Query`, and does not retry operations with another method. Custom transports own routing and must prevent mutations over GET and QUERY. GraphiQL reads metadata from each response without subscribing to transport capability changes.1.0.0-rc.0
### Patch Changes
- [#4595](https://github.com/graphql/graphiql/pull/4595) [`bcd13dc`](https://github.com/graphql/graphiql/commit/bcd13dca46e2bb75837b33fce9f574712c669457) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Move the GraphiQL 6 package family from beta to release candidate versions.1.0.0-beta.2
### Minor Changes
- [#4333](https://github.com/graphql/graphiql/pull/4333) [`093cb10`](https://github.com/graphql/graphiql/commit/093cb100a4524b1005b82c1c064bb897416bfc82) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Add a structured `Transport` API alongside the existing `Fetcher`. `createTransport({...})` performs the GraphQL request and returns a `TransportResponse` carrying the real HTTP wire metadata (status, headers, timing, size) for queries, mutations, subscriptions, and incremental delivery, so the response pane can surface those values directly instead of fabricating them. That metadata is there even when the response body isn't valid JSON (an HTML error page from a proxy, a plain-text 401), so a broken response still shows its real status code instead of a generic error. `<GraphiQL>` accepts a new `transport` prop, mutually exclusive with `fetcher` at the type level.
Transports support GET, POST, and the [HTTP `QUERY`](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/) method per the GraphQL over HTTP spec. Pass `method` / `supportedMethods` to choose; GET encodes the query into the URL with no body, `QUERY` sends a JSON body but is safe and idempotent, and mutations are always sent over POST (or blocked when POST is unavailable). `Transport` exposes `url`, `method`, `supportedMethods`, and an optional `setMethod`, and the top bar shows the active method and endpoint with an inline switcher that cycles through the supported methods. Every request, incremental delivery on or off, sends `application/graphql-response+json` in its `accept` header alongside `application/json`, so spec-compliant servers don't fall back to legacy response semantics. Subscriptions require an explicit `subscriptionClient` satisfying a small `SubscriptionClient` contract: a single `.iterate(request)` method that `graphql-ws` v6 and `graphql-sse` clients meet directly. The low-level `simpleHttpTransport` and `multipartHttpTransport` primitives also accept an optional `method`.
`TransportRequest` carries `extensions` for GraphQL-over-HTTP extensions such as automatic persisted queries (encoded into the URL for `GET`, included in the JSON body for `POST` and `QUERY`), and `signal`, an `AbortSignal` that cancels an in-flight query or mutation. Stopping a running query or mutation aborts the request; stopping a subscription closes the underlying socket or SSE connection. `TransportResponse.ok` reflects both layers: the HTTP status and the absence of top-level GraphQL errors, so a 401 or 500 is never `ok: true` just because its body happens to parse as JSON with no `errors`.
Plugins can observe and transform traffic through `transport.onBeforeSend`, `transport.onResponse`, and `transport.onError`, available via `useGraphiQLPluginContext()` (all three return a cleanup function; the `transport` field is `undefined` under the legacy `fetcher` path, so guard with optional chaining). `onError` fires when a request fails outri1.0.0-beta.1
### Major Changes
- [#4478](https://github.com/graphql/graphiql/pull/4478) [`066528a`](https://github.com/graphql/graphiql/commit/066528a6bb7706d685536888d7b5549d6fd5a109) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - GraphQL.js 15 and 16.0–16.10 are no longer supported peer dependencies. The supported range is `^16.11.0 || ^17.0.0`. GraphQL.js 16.11 fixes OneOf input validation for nullable variables and tightens input-object coercion to reject arrays, giving GraphiQL 6 a correct baseline for OneOf inputs. Upgrade `graphql` before upgrading these packages.Dai questi dati al tuo agente IA
Vigia è un server MCP gratuito: il tuo agente di programmazione verifica versioni, modifiche incompatibili e vulnerabilità prima di scrivere codice. Senza registrazione né chiave API.
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Aggiungi a CursorAggiungi a VS Code★ Stella su GitHub
Qualsiasi altro client MCP
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }Skill per agenti (SKILL.md): dice all'agente quando usare Vigia · GitHub Action per le pull request
Domande frequenti
Quali sono le modifiche incompatibili aggiornando @graphiql/toolkit da 0 a 1?
Tra @graphiql/toolkit 0.12.1 e 1.0.0, Vigia ha trovato 0 export rimossi, 3 firme modificate e 4 membri di classi o interfacce rimossi o modificati.
Cosa è stato deprecato in @graphiql/toolkit 1?
5 export o membri risultano ora deprecati in @graphiql/toolkit 1.0.0.
Per gli agenti
GET https://vigia.coredls.cloud/v1/packages/npm/@graphiql/toolkit/upgrade?from=0.12.1&to=1.0.0