Skip to content
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): support SOAP headers and customize aliases #8196

Merged
merged 18 commits into from
Jan 7, 2025
Merged

Conversation

ardatan
Copy link
Owner

@ardatan ardatan commented Dec 27, 2024

  • You can now choose the name of the alias you want to use for SOAP body;
import { defineConfig } from '@graphql-mesh/compose-cli'

export const composeConfig = defineConfig({
  sources: [
    {
      sourceHandler: loadSOAPSubgraph('CountryInfo', {
        source:
          'http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL',
        bodyAlias: 'my-body'
      })
    }
  ]
})
  • Then it will generate a body like below by using the alias;
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:my-body="http://foo.com/">
   <soap:Body>
      <my-body:Foo>
          <my-body:Bar>baz</my-body:Bar>
      </my-body:Foo>
   </soap:Body>
</soap:Envelope>

If you want to add SOAP headers to the request body like below;

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:header="http://foo.com/">
   <soap:Header>
      <header:MyHeader>
         <header:UserName>user</header:UserName>
         <header:Password>password</header:Password>
      </header:MyHeader>
   </soap:Header>

You can add the headers to the configuration like below;

import { defineConfig } from '@graphql-mesh/compose-cli'
import { loadSOAPSubgraph } from '@omnigraph/soap'

export const composeConfig = defineConfig({
  subgraphs: [
    {
      sourceHandler: loadSOAPSubgraph('CountryInfo', {
        source:
          'http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL',
        soapHeaders: {
          alias: 'header',
          namespace: 'http://foo.com',
          headers: {
            MyHeader: {
              UserName: 'user',
              Password: 'password'
            }
          }
        }
      })
    }
  ]
})

Copy link
Contributor

github-actions bot commented Dec 27, 2024

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-mesh/cache-cfw-kv 0.104.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/cache-file 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/cache-inmemory-lru 0.0.7-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/cache-localforage 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/cache-redis 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/compose-cli 1.3.5-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-composition 0.7.17-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/include 0.2.10-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/apollo-link 0.105.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/cli 0.98.17-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/config 0.106.17-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/graphql 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/grpc 0.107.1-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/json-schema 0.108.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/mongoose 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/mysql 0.104.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/neo4j 0.105.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/odata 0.105.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/openapi 0.108.13-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/postgraphile 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/raml 0.108.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/soap 0.105.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/supergraph 0.9.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/thrift 0.105.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/tuql 0.104.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/http 0.105.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/merger-bare 0.104.14-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/merger-stitching 0.104.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/migrate-config-cli 1.4.9-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/runtime 0.105.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/store 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-cache 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-encapsulate 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-extend 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-federation 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-filter-schema 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-hive 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-hoist-field 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-naming-convention 0.103.13-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-prefix 0.103.13-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-prune 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-rate-limit 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-rename 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-replace-field 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-resolvers-composition 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-transfer-schema 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transform-type-merging 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/types 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/urql-exchange 0.105.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/utils 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/json-schema 0.108.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/mysql 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/neo4j 0.9.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/odata 0.1.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/openapi 0.108.13-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/raml 0.108.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/soap 0.105.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/sqlite 0.7.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@omnigraph/thrift 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-deduplicate-request 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-hive 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-http-cache 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-http-details-extensions 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-jit 0.1.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-jwt-auth 1.4.1-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-live-query 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-mock 0.103.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-newrelic 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-operation-field-permissions 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-operation-headers 1.3.12-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-rate-limit 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-response-cache 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-snapshot 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-statsd 0.103.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-grpc 0.2.1-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-mysql 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-neo4j 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-odata 0.1.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-rest 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-soap 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-sqlite 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-thrift 0.8.11-alpha-20250106110256-2e234364f5ce4bfad7ad41bdf42e62bb93c9e3b7 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Dec 27, 2024

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

Copy link
Contributor

github-actions bot commented Dec 27, 2024

💻 Website Preview

The latest changes are available as preview in: https://984ca100.graphql-mesh.pages.dev

@ardatan ardatan changed the title feat(soap): support SOAP headers feat(soap): support SOAP headers and customize aliases Jan 2, 2025
@ardatan ardatan force-pushed the header-support branch 2 times, most recently from bfd6e3d to 8e6ad9e Compare January 6, 2025 10:57
@ardatan ardatan merged commit 3fc1f3e into master Jan 7, 2025
15 checks passed
@ardatan ardatan deleted the header-support branch January 7, 2025 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants