graphql-mesh web service 集成

前边有介绍过graphql-mesh 的基本使用,以下是一个集成web service 的简单学习

环境准备

  • 项目初始化
yarn  init -y
  • 添加依赖
yarn add graphql @graphql-mesh/runtime @graphql-mesh/cli   @graphql-mesh/soap soap
  • package.json
{
  "name": "second",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "@graphql-mesh/cli": "^0.0.16",
    "@graphql-mesh/runtime": "^0.0.16",
    "@graphql-mesh/soap": "^0.0.16",
    "graphql": "^14.6.0",
    "soap": "^0.31.0"
  },
  "scripts": {
    "start": "graphql-mesh serve"
  }
}

集成使用

  • .meshrc.yml 文件
sources:
  - name: CountryInfo
    handler:
      soap:
        wsdl: http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL
  • 启动
yarn start
  • 效果

地址 http://localhost:4000

 

 

  • 查询

 

 

说明

graphql-mesh 集成web service 简单高效,使用简单

参考资料

https://github.com/Urigo/graphql-mesh

posted on   荣锋亮  阅读(308)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2019-03-25 terraform plugin 版本以及changlog 规范
2019-03-25 Terraform Detecting Drift
2019-03-25 使用terraform-provider-s3 操作minio
2019-03-25 Terraform 自定义provider 开发
2019-03-25 Writing Custom Providers
2017-03-25 luarocks 安装
2017-03-25 几个中文排版web 类库

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示