-
Notifications
You must be signed in to change notification settings - Fork 348
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
feat(soap): auto detection of SOAP namespace, and allow to customize it #8414
base: master
Are you sure you want to change the base?
Conversation
Apollo Federation Subgraph Compatibility Results
Learn more: |
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-mesh/cache-cfw-kv |
0.104.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/cache-file |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/cache-inmemory-lru |
0.0.15-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/cache-localforage |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/cache-redis |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/cache-upstash-redis |
0.0.6-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/compose-cli |
1.3.13-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/fusion-composition |
0.7.25-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/include |
0.2.18-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/apollo-link |
0.105.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/cli |
0.98.26-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/config |
0.106.26-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/graphql |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/grpc |
0.107.10-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/json-schema |
0.108.22-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/mongoose |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/mysql |
0.104.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/neo4j |
0.105.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/odata |
0.105.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/openapi |
0.108.23-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/postgraphile |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/raml |
0.108.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/soap |
0.106.0-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/supergraph |
0.9.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/thrift |
0.105.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/tuql |
0.104.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/http |
0.105.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/merger-bare |
0.104.22-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/merger-stitching |
0.104.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/migrate-config-cli |
1.4.18-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/runtime |
0.105.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/store |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-cache |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-encapsulate |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-extend |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-federation |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-filter-schema |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-hive |
0.103.22-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-hoist-field |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-naming-convention |
0.103.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-prefix |
0.103.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-prune |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-rate-limit |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-rename |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-replace-field |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-resolvers-composition |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-transfer-schema |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transform-type-merging |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/types |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/urql-exchange |
0.105.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/utils |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/json-schema |
0.108.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/mysql |
0.8.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/neo4j |
0.9.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/odata |
0.1.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/openapi |
0.108.23-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/raml |
0.108.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/soap |
0.106.0-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/sqlite |
0.7.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/thrift |
0.8.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-deduplicate-request |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-hive |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-http-cache |
0.104.7-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-http-details-extensions |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-jit |
0.1.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-jwt-auth |
1.4.9-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-live-query |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-mock |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-newrelic |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-operation-field-permissions |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-operation-headers |
1.3.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-rate-limit |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-response-cache |
0.103.22-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-snapshot |
0.103.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-statsd |
0.103.20-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-grpc |
0.2.9-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-mysql |
0.8.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-neo4j |
0.8.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-odata |
0.1.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-rest |
0.8.21-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-soap |
0.9.0-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-sqlite |
0.8.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-thrift |
0.8.19-alpha-20250222124701-053fde512fa0145b42709d8b56de6a8968a0c712 |
npm ↗︎ unpkg ↗︎ |
💻 Website PreviewThe latest changes are available as preview in: https://3feb7ebb.graphql-mesh.pages.dev |
📝 WalkthroughWalkthroughThis update enhances SOAP handling across the project by introducing automatic detection of the SOAP version to set the appropriate namespace. New configuration options, especially the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Loader as SOAPLoader
participant Config as LoaderOptions / Annotations
participant Executor
participant Logger
Client->>Loader: Invoke SOAP subgraph loading
Loader->>Config: Check for custom soapNamespace option
alt SOAP 1.1 detected
Config-->>Loader: Return "http://schemas.xmlsoap.org/soap/envelope/"
else SOAP 1.2 detected
Config-->>Loader: Return "http://www.w3.org/2003/05/soap-envelope"
end
Loader->>Executor: Pass SOAP definition with soapNamespace
Executor->>Logger: Log warning if soapNamespace is missing
Logger-->>Executor: Confirm default namespace used
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
packages/transports/soap/src/executor.tsOops! Something went wrong! :( ESLint: 9.20.1 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (2)
packages/loaders/soap/src/index.ts (1)
48-59
:⚠️ Potential issuePass
soapNamespace
option to SOAPLoader.The
soapNamespace
option is not being propagated to the SOAPLoader constructor.Apply this diff:
const soapLoader = new SOAPLoader({ subgraphName, fetch, logger, cwd, // Configuration from the user schemaHeaders: options.schemaHeaders, operationHeaders: options.operationHeaders, endpoint: options.endpoint, bodyAlias: options.bodyAlias, soapHeaders: options.soapHeaders, + soapNamespace: options.soapNamespace, });
examples/soap-demo/tests__bak/soap-demo.test.ts.bak (1)
1-41
:⚠️ Potential issueRemove
.bak
extension from the test file.The
.bak
extension suggests this is a backup file. If this is the active test file, it should be renamed to remove the.bak
extension.Run this command to rename the file:
#!/bin/bash mv examples/soap-demo/tests__bak/soap-demo.test.ts.bak examples/soap-demo/tests/soap-demo.test.ts
🧹 Nitpick comments (3)
packages/loaders/soap/src/SOAPLoader.ts (1)
409-411
: Consider enhancing SOAP version detection.The current implementation only checks for the presence of
soap12
attribute. Consider:
- Adding more robust version detection logic
- Extracting the version detection logic into a separate method for better maintainability
- if (definition.attributes.soap12) { - this.soapNamespace = 'http://www.w3.org/2003/05/soap-envelope'; - } + private detectSoapVersion(definition: WSDLDefinition): string { + // Check for SOAP 1.2 indicators + if ( + definition.attributes.soap12 || + definition.types?.some(type => + type.schema.some(schema => + schema.import?.some(imp => + imp.attributes.namespace === 'http://www.w3.org/2003/05/soap-envelope' + ) + ) + ) + ) { + return 'http://www.w3.org/2003/05/soap-envelope'; + } + // Default to SOAP 1.1 + return 'http://schemas.xmlsoap.org/soap/envelope/'; + } + + // In loadDefinition method + this.soapNamespace = this.detectSoapVersion(definition);website/src/pages/docs/handlers/soap.mdx (2)
87-89
: Improve clarity of the documentation.The sentence structure could be improved for better readability:
-By default, Mesh detects the namespace from the WSDL file. If you want to use a custom namespace -based on SOAP version. +By default, Mesh detects the SOAP version from the WSDL file and automatically sets the appropriate namespace.🧰 Tools
🪛 LanguageTool
[style] ~87-~87: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...he namespace from the WSDL file. If you want to use a custom namespace based on SOAP ve...(REP_WANT_TO_VB)
90-102
: Consider adding more context to the documentation.The documentation would benefit from:
- Example XML output showing the namespace in use
- Note about precedence between auto-detection and custom namespace
Add the following content:
For example, with SOAP 1.2, the generated XML will look like: ```xml <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Body> <!-- ... --> </soap:Body> </soap:Envelope>Note: When a custom namespace is specified, it takes precedence over the auto-detected version.
<details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [style] ~93-~93: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing. Context: ....w3.org/2003/05/soap-envelope`. If you want to use a custom namespace, you can set it ... (REP_WANT_TO_VB) </details> </details> </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 6e68b0da318f2ec3bd761722b5cbda2249f8e4e2 and 6a9788f8d26ce4a03f3c21a78f3e580203cc0640. </details> <details> <summary>⛔ Files ignored due to path filters (4)</summary> * `e2e/soap-demo/__snapshots__/soap-demo.test.ts.snap` is excluded by `!**/*.snap` * `packages/loaders/soap/test/__snapshots__/examples.test.ts.snap` is excluded by `!**/*.snap` * `packages/loaders/soap/test/__snapshots__/soap.test.ts.snap` is excluded by `!**/*.snap` * `packages/transports/soap/tests/__snapshots__/headers.spec.ts.snap` is excluded by `!**/*.snap` </details> <details> <summary>📒 Files selected for processing (10)</summary> * `.changeset/tangy-moons-post.md` (1 hunks) * `examples/soap-demo/tests/soap-demo.test.ts` (0 hunks) * `examples/soap-demo/tests__bak/soap-demo.test.ts.bak` (1 hunks) * `packages/loaders/soap/src/SOAPLoader.ts` (6 hunks) * `packages/loaders/soap/src/index.ts` (1 hunks) * `packages/loaders/soap/src/types.ts` (1 hunks) * `packages/loaders/soap/src/utils.ts` (1 hunks) * `packages/transports/soap/src/executor.ts` (2 hunks) * `website/src/pages/docs/handlers/soap.mdx` (1 hunks) * `website/src/pages/v1/source-handlers/soap.mdx` (1 hunks) </details> <details> <summary>💤 Files with no reviewable changes (1)</summary> * examples/soap-demo/tests/soap-demo.test.ts </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 LanguageTool</summary> <details> <summary>.changeset/tangy-moons-post.md</summary> [misspelling] ~5-~5: This word is normally spelled with a hyphen. Context: ...p': minor '@omnigraph/soap': minor --- Auto detection of SOAP version to decide SOAP namespac... (EN_COMPOUNDS_AUTO_DETECTION) </details> <details> <summary>website/src/pages/docs/handlers/soap.mdx</summary> [style] ~87-~87: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing. Context: ...he namespace from the WSDL file. If you want to use a custom namespace based on SOAP ve... (REP_WANT_TO_VB) --- [style] ~93-~93: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing. Context: ....w3.org/2003/05/soap-envelope`. If you want to use a custom namespace, you can set it ... (REP_WANT_TO_VB) </details> </details> </details> <details> <summary>⏰ Context from checks skipped due to timeout of 90000ms (3)</summary> * GitHub Check: e2e / node v22 * GitHub Check: e2e / node v20 * GitHub Check: e2e / node v18 </details> <details> <summary>🔇 Additional comments (7)</summary><blockquote> <details> <summary>packages/loaders/soap/src/types.ts (1)</summary> `4-4`: <details> <summary>❓ Verification inconclusive</summary> **LGTM! Verify SOAP 1.2 attribute usage.** The `soap12` attribute is correctly defined as an optional string property in the `WSDLDefinitionAttributes` interface. Let's verify how this attribute is used in WSDL files: --- 🏁 Script executed: ```shell #!/bin/bash # Search for SOAP 1.2 namespace usage in WSDL files rg -t xml "http://www.w3.org/2003/05/soap-envelope" -A 5
Length of output: 56
LGTM – Proceed with Caution
The addition of the
soap12
property in theWSDLDefinitionAttributes
interface is correctly implemented and maintains backward compatibility for detecting SOAP versions. However, the automated search for the SOAP 1.2 namespace (http://www.w3.org/2003/05/soap-envelope
) did not return any results. Please verify manually whether your WSDL files are expected to reference SOAP 1.2. If such references should exist, ensure that the corresponding WSDL files include the SOAP 1.2 namespace; otherwise, the attribute might not be utilized as anticipated.
packages/loaders/soap/src/index.ts (1)
37-43
: LGTM! Clear and informative documentation.
The JSDoc clearly explains the auto-detection behavior and default namespaces for different SOAP versions.
packages/transports/soap/src/executor.ts (1)
92-92
: LGTM!
The addition of the soapNamespace
property to the SoapAnnotations
interface and its usage in the envelope attributes is well-implemented. This change enables dynamic SOAP namespace support based on the SOAP version or custom configuration.
Also applies to: 146-146
packages/loaders/soap/src/SOAPLoader.ts (1)
80-80
: LGTM!
The addition of the soapNamespace
property to the interfaces and class is well-implemented. This change enables custom SOAP namespace support while maintaining backward compatibility.
Also applies to: 146-148, 203-203, 216-216
.changeset/tangy-moons-post.md (1)
1-28
: LGTM!
The changeset is well-documented and includes:
- Clear description of the SOAP version auto-detection feature
- Default namespace values for each SOAP version
- Example configuration for custom namespace
🧰 Tools
🪛 LanguageTool
[misspelling] ~5-~5: This word is normally spelled with a hyphen.
Context: ...p': minor '@omnigraph/soap': minor --- Auto detection of SOAP version to decide SOAP namespac...
(EN_COMPOUNDS_AUTO_DETECTION)
website/src/pages/v1/source-handlers/soap.mdx (2)
122-130
: Documentation Enhancement: Custom SOAP Namespace Overview
The new section clearly explains how Mesh auto-detects the SOAP namespace based on the WSDL file details and describes the defaults for SOAP 1.1 and 1.2. This explanation provides useful context before showing the configuration snippet. Consider a quick review of the spacing between lines for consistency with the rest of the document; however, the content is clear and concise.
131-147
: Configuration Example Accuracy: Custom SOAP Namespace Setup
The provided TypeScript code snippet succinctly demonstrates how to override the default SOAP namespace by utilizing the soapNamespace
property within the loadSOAPSubgraph
configuration. The imports and configuration usage are consistent with other examples in the docs, making it easy for users to adapt this setup.
ed73958
to
c4e9853
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
.changeset/tangy-moons-post.md (1)
8-8
: Fix hyphenation in the description."Auto detection" should be hyphenated as "Auto-detection" for correct compound word formatting.
-Auto detection of SOAP version to decide SOAP namespace; +Auto-detection of SOAP version to decide SOAP namespace;website/src/generated-markdown/SoapHandler.generated.md (1)
17-20
: Fix list item indentation.The
soapNamespace
property documentation should maintain consistent indentation with other properties in the list.-* `soapNamespace` (type: `String`) - The namespace of the SOAP envelope -By default, SOAP handler detects the SOAP version and if SOAP version is 1.1, -it uses `http://schemas.xmlsoap.org/soap/envelope/` namespace -If SOAP version is 1.2, it uses `http://www.w3.org/2003/05/soap-envelope` namespace +* `soapNamespace` (type: `String`) - The namespace of the SOAP envelope + By default, SOAP handler detects the SOAP version and if SOAP version is 1.1, + it uses `http://schemas.xmlsoap.org/soap/envelope/` namespace + If SOAP version is 1.2, it uses `http://www.w3.org/2003/05/soap-envelope` namespace🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
17-17: Inconsistent indentation for list items at the same level
Expected: 2; Actual: 0(MD005, list-indent)
website/src/pages/docs/handlers/soap.mdx (1)
85-102
: Custom SOAP Namespace Documentation:The new "Custom SOAP namespace" section is well integrated into the docs. It clearly explains that the Mesh handler auto-detects the SOAP version and uses the corresponding default namespace while also allowing users to override it via the
soapNamespace
property. The YAML snippet example is clear and practical.One minor suggestion: consider varying the phrasing in parts of the description (especially around lines ~87 and ~93) to avoid repetition, as highlighted by static analysis hints. This will improve readability without altering the meaning.
🧰 Tools
🪛 LanguageTool
[style] ~87-~87: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...he namespace from the WSDL file. If you want to use a custom namespace based on SOAP ve...(REP_WANT_TO_VB)
[style] ~93-~93: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ....w3.org/2003/05/soap-envelope`. If you want to use a custom namespace, you can set it ...(REP_WANT_TO_VB)
packages/legacy/types/src/config-schema.json (1)
3073-3075
: Add Custom SOAP Namespace Property:The addition of the
soapNamespace
property in theSoapHandler
definition is well executed. The property is defined as a string and its description clearly explains the default behavior—usinghttp://schemas.xmlsoap.org/soap/envelope/
for SOAP 1.1 andhttp://www.w3.org/2003/05/soap-envelope
for SOAP 1.2—while also enabling a custom override.Minor language adjustments could further improve clarity (for example, consider breaking the description into a couple of shorter sentences), but overall the implementation aligns well with the PR objectives.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
e2e/soap-demo/__snapshots__/soap-demo.test.ts.snap
is excluded by!**/*.snap
packages/loaders/soap/test/__snapshots__/examples.test.ts.snap
is excluded by!**/*.snap
packages/loaders/soap/test/__snapshots__/soap.test.ts.snap
is excluded by!**/*.snap
packages/transports/soap/tests/__snapshots__/headers.spec.ts.snap
is excluded by!**/*.snap
📒 Files selected for processing (15)
.changeset/tangy-moons-post.md
(1 hunks)examples/soap-demo/tests__bak/soap-demo.test.ts.bak
(1 hunks)packages/legacy/handlers/soap/yaml-config.graphql
(1 hunks)packages/legacy/types/src/config-schema.json
(1 hunks)packages/legacy/types/src/config.ts
(1 hunks)packages/loaders/soap/src/SOAPLoader.ts
(6 hunks)packages/loaders/soap/src/index.ts
(1 hunks)packages/loaders/soap/src/types.ts
(1 hunks)packages/loaders/soap/src/utils.ts
(1 hunks)packages/loaders/soap/test/soap.test.ts
(3 hunks)packages/transports/soap/src/executor.ts
(7 hunks)packages/transports/soap/src/index.ts
(1 hunks)website/src/generated-markdown/SoapHandler.generated.md
(1 hunks)website/src/pages/docs/handlers/soap.mdx
(1 hunks)website/src/pages/v1/source-handlers/soap.mdx
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- packages/loaders/soap/src/types.ts
- packages/loaders/soap/src/index.ts
- packages/loaders/soap/src/utils.ts
- packages/loaders/soap/src/SOAPLoader.ts
- website/src/pages/v1/source-handlers/soap.mdx
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
website/src/generated-markdown/SoapHandler.generated.md
17-17: Inconsistent indentation for list items at the same level
Expected: 2; Actual: 0
(MD005, list-indent)
🪛 LanguageTool
.changeset/tangy-moons-post.md
[misspelling] ~7-~7: This word is normally spelled with a hyphen.
Context: ...minor '@graphql-mesh/types': patch --- Auto detection of SOAP version to decide SOAP namespac...
(EN_COMPOUNDS_AUTO_DETECTION)
website/src/pages/docs/handlers/soap.mdx
[style] ~87-~87: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...he namespace from the WSDL file. If you want to use a custom namespace based on SOAP ve...
(REP_WANT_TO_VB)
[style] ~93-~93: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ....w3.org/2003/05/soap-envelope`. If you want to use a custom namespace, you can set it ...
(REP_WANT_TO_VB)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: unit / node 20
- GitHub Check: e2e / node v22
- GitHub Check: unit / node 18
- GitHub Check: e2e / node v20
- GitHub Check: e2e / node v18
🔇 Additional comments (7)
packages/transports/soap/src/index.ts (1)
7-8
: LGTM! Logger integration looks good.The addition of the logger parameter enhances observability of SOAP operations.
Also applies to: 15-15
examples/soap-demo/tests__bak/soap-demo.test.ts.bak (1)
10-38
: Add test cases for SOAP namespace functionality.The test suite should include specific test cases for:
- Auto-detection of SOAP version
- Custom SOAP namespace configuration
Add these test cases:
it('should give correct response for example queries', async () => { for (const source of config.documents) { if (!source.document || !source.location) { throw new Error(`Invalid document config: ${inspect(source)}`); } const result = await mesh.execute(source.document); expect(result.errors).toBeUndefined(); expect(result).toMatchSnapshot(basename(source.location) + '-soap-demo-result'); } }); + it('should detect SOAP version correctly', async () => { + const result = await mesh.execute(/* GraphQL */ ` + query TestSoapVersion { + soapVersion + } + `); + expect(result.data?.soapVersion).toMatch(/1\.[12]/); + }); + it('should use custom SOAP namespace when configured', async () => { + const customNamespace = 'http://foo.com/schemas/soap/envelope'; + const result = await mesh.execute(/* GraphQL */ ` + query TestCustomNamespace($namespace: String!) { + soapNamespace(namespace: $namespace) + } + `, { + variables: { namespace: customNamespace } + }); + expect(result.data?.soapNamespace).toBe(customNamespace); + });packages/loaders/soap/test/soap.test.ts (1)
18-18
: Clarify why the SOAP call test is skipped.While the TODO comment mentions "Implement this locally later", it would be helpful to understand:
- Why was the test working before and not now?
- What specific local implementation is needed?
- What E2E tests cover this functionality?
packages/transports/soap/src/executor.ts (1)
310-315
: LGTM! Logger integration is well-implemented.Good practices observed:
- Default logger prevents null pointer issues
- Logger parameter is consistently passed through the call chain
packages/legacy/types/src/config.ts (1)
1022-1028
: LGTM! Well-documented addition of thesoapNamespace
property.The new optional property is properly typed and includes comprehensive JSDoc comments explaining the automatic SOAP version detection behavior and namespace defaults.
.changeset/tangy-moons-post.md (1)
1-6
: LGTM! Appropriate version bumps for the feature scope.The version bumps align well with the scope of changes:
- Minor bumps for packages with new features
- Patch bump for types package with non-breaking additions
packages/legacy/handlers/soap/yaml-config.graphql (1)
32-38
: LGTM! Well-structured schema addition.The
soapNamespace
field is properly defined with comprehensive documentation explaining the automatic version detection behavior and default namespaces.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/transports/soap/src/executor.ts (1)
240-262
: Consider adding error logging for better observability.While the error handling is comprehensive, adding error logging would improve observability and debugging capabilities.
try { const responseJSON = xmlToJSONConverter.parse(responseXML, parseXmlOptions); return normalizeResult(responseJSON.Envelope[0].Body[0][soapAnnotations.elementName]); } catch (e) { + logger.error(`Failed to parse SOAP response: ${e.message}`, { + error: e, + subgraph: soapAnnotations.subgraph, + endpoint: soapAnnotations.endpoint, + }); return createGraphQLError(`Invalid SOAP response: ${e.message}`, { extensions: { subgraph: soapAnnotations.subgraph, request: { url: soapAnnotations.endpoint, method: 'POST', body: requestXML, }, response: { status: response.status, statusText: response.statusText, get headers() { return Object.fromEntries(response.headers.entries()); }, body: responseXML, }, }, }); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/transports/soap/src/executor.ts
(7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: e2e / node v20
🔇 Additional comments (4)
packages/transports/soap/src/executor.ts (4)
15-16
: LGTM! Interface changes align with PR objectives.The addition of the
soapNamespace
property toSoapAnnotations
and thelogger
property toCreateRootValueMethodOpts
properly supports the new SOAP namespace customization feature.Also applies to: 89-101, 103-110
147-152
: LGTM! Correct implementation of SOAP namespace validation.The validation logic correctly checks for missing
soapNamespace
and provides an appropriate fallback to SOAP 1.2 namespace with a warning message.
154-156
: LGTM! Proper integration of custom SOAP namespace.The envelope attributes correctly use the dynamic
soapNamespace
value, enabling customization of the SOAP version.
310-320
: LGTM! Proper integration of logging capabilities.The executor creation properly integrates logging capabilities with a sensible default, maintaining backward compatibility.
Auto detection of SOAP version to decide SOAP namespace;
For SOAP 1.1, it is set to
http://schemas.xmlsoap.org/soap/envelope/
and for SOAP 1.2, it is set tohttp://www.w3.org/2003/05/soap-envelope
.If you want to use a custom namespace, you can set it like below;
Summary by CodeRabbit
New Features
Documentation