| 开发者 |
jasonbahl
joefusco |
|---|---|
| 更新时间 | 2026年6月11日 05:36 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPL-3.0 |
| 版权网址: | 版权信息 |
wp-admin/admin.php?page=graphql-ide@wordpress/components and @wordpress/data. The legacy GraphiQL wrapper is gone — see the Upgrade Notice if you have customizations.wp-graphql-smart-cache's graphql_document post type — one canonical primitive for the WPGraphQL ecosystem. The IDE works standalone when Smart Cache isn't installed; Saved Queries / Document Settings / share links light up when it is.@wordpress/i18n under the wpgraphql-ide text domain.UPGRADE-5.0.md in the plugin or the project's GitHub releases.
manage_graphql_ide capability, which is granted to administrators by default. Hosts can override the capability requirement via the wpgraphql_ide_capability_required filter.The plugin adds three entry points: a dedicated admin page under GraphQL → GraphQL IDE, a slide-up drawer triggered from the GraphQL IDE link in the admin bar (works on every wp-admin and front-end page), and an opt-in public endpoint mode that renders the IDE when you visit the GraphQL endpoint URL in a browser.
No — the IDE works as a standalone GraphQL client without it. Smart Cache is optional but unlocks the saved-document features: the Saved Queries panel, personal collections, share links, and the Document Settings drawer. Install Smart Cache and the IDE detects it automatically; no configuration needed.
5.0 rebuilds the UI on @wordpress/components and CodeMirror 6, moves saved-document storage onto Smart Cache's graphql_document post type, and ships full internationalization. Extension authors should consult UPGRADE-5.0.md (bundled with the plugin) — several legacy hooks were renamed, and a few were briefly removed and then restored with improved behavior. Open tabs and query history saved by 4.x are migrated forward automatically on first 5.0 load.
Under GraphQL → IDE Settings, check Public IDE at GraphQL endpoint. Once enabled, browser visits to the GraphQL endpoint URL (with an HTML Accept header) render the IDE shell instead of returning JSON. API clients (curl, fetch with Content-Type: application/json, GraphQL clients in general) keep getting JSON as before. Optionally enable Allow sign-in on the public IDE to surface a sign-in prompt to anonymous visitors.
The non-compressed source code for the JavaScript and CSS files is available in the following directories:
cm6-graphql for schema-aware GraphQL highlighting + autocomplete@wordpress/components and @wordpress/data — UI primitives and state management@graphiql/toolkit — fragment-merging utilities reused from the GraphiQL projectOpen an issue at github.com/wp-graphql/wp-graphql. For security issues, please follow the security policy instead of filing a public issue.
WPGraphQL IDE uses the Appsero SDK to collect telemetry data only after user consent. This helps improve the plugin while respecting user privacy. When telemetry is enabled, the same payloads are also mirrored to WPGraphQL-operated infrastructure at https://telemetry.wpgraphql.com.
@wordpress/components + @wordpress/data + CodeMirror 6. Legacy GraphiQL wrapper removed.graphql_document post type. The IDE-owned graphql_ide_query post type, graphql_ide_collection taxonomy, and Document-Settings taxonomies are removed. Saved Queries / Document Settings / share links require Smart Cache to be active.IdeQuery, IdeQueries, IdeCollection, IdeCollections removed. Use graphqlDocument / graphqlDocumentGroup (from Smart Cache) instead./wpgraphql-ide/v1/documents/:id/publish and /wpgraphql-ide/v1/documents/collections/:id. The publish flow is now a standard POST /wp/v2/graphql_document/:id; cascade-delete is client-side.wpgraphql_ide_capability_required filter now consulted at every IDE permission check — REST callbacks, post-type / taxonomy capability maps, meta auth, admin menu, public-endpoint flag. Hosts overriding the cap to a different value will now find their override honored end-to-end (previously only the admin menu link was gated).graphiql_* hook aliases dropped (enqueue_graphiql_extension, graphiql_external_fragments, graphiql_rendered, graphiql_toolbar_before_buttons, graphiql_toolbar_after_buttons). Use the canonical wpgraphql_ide_* / wpgraphql-ide.* names.SmartCacheBridge. GraphQL fields variables and headers added to GraphqlDocument (read + Create/Update inputs) for execution context.gql() client. REST remains for user preferences, the aggregated documentSettings readback field, and bulk import/export/reorder. Execution history is browser-local.@wordpress/i18n with the wpgraphql-ide text domain.graphiql:tabState) and query history (graphiql:queries) saved by the legacy GraphiQL UI migrate forward on first 5.0 load; legacy localStorage keys are cleared.wpgraphql_ide_external_fragments filter restored with smarter merge behavior — only fragments referenced by the outgoing query are prepended, with transitive resolution between external fragments.registerPreference (typed device/user prefs), executeRequest / executeResponse filters, wpgraphql-ide.afterExecute action.register_graphql_field() (#3539)wp_localize_escaped_data() function for recursively escaping data before localizing it in WordPress. This ensures safe output of strings, URLs, integers, and nested arrays when passing data to JavaScript, using native WordPress functions like wp_kses_post() and esc_url().wp_localize_script(), preventing potential XSS vulnerabilities and ensuring safe use of dynamic data in JavaScript.