graphql2rest:GraphQL到REST转换器:从您现有的GraphQL API自动生成RESTful API

时间:2021-01-30 16:15:08
【文件属性】:
文件名称:graphql2rest:GraphQL到REST转换器:从您现有的GraphQL API自动生成RESTful API
文件大小:265KB
文件格式:ZIP
更新时间:2021-01-30 16:15:08
api graphql rest api-gateway rest-api GraphQL2REST 从现有的GraphQL API自动生成RESTful API GraphQL2REST是一个Node.js库,可读取您的GraphQL模式和用户提供的清单文件,并自动生成具有完全RESTful HTTP路由(即成熟的REST API)的Express路由器。 为什么? 您已有一个GraphQL API,但是需要将其公开为REST,因为这是您的API用户想要的 您想免费开发一个新的GraphQL API并在其之上获得REST 您想从内部受益于GraphQL,同时在外部将REST作为公共API公开 GraphQL2REST允许您完全配置和自定义REST API,它可以位于非常不同的GraphQL层之上(请参阅)。 目录 安装 npm: npm i graphql2rest 纱: yarn add graphql2rest 用法 基本示例: 给定一个简单的GraphQL模式: type Query { getUser ( userId : UUID ! ): User } type Mutation { createUser ( name :
【文件预览】:
graphql2rest-master
----.gitignore(630B)
----.babelrc(766B)
----.eslintrc(2KB)
----package.json(3KB)
----package-lock.json(335KB)
----src()
--------setup.js(4KB)
--------graphql2rest.js(17KB)
--------common.js(398B)
--------index.js(192B)
--------errorHandling.js(2KB)
--------gqlgenerator()
--------consts.js(555B)
--------logging.js(1KB)
--------formatters.js(892B)
----CONTRIBUTING.md(2KB)
----LICENSE(1KB)
----.github()
--------workflows()
----examples()
--------index.js(3KB)
--------myManifest.json(293B)
----README.md(16KB)
----config()
--------defaults.json(265B)
----.eslintignore(43B)
----manifest.json(398B)
----.npmignore(652B)
----docs()
--------Hiding fields in REST responses.md(914B)
--------Mapping with conditional logic.md(4KB)
--------Pre-processing step.md(3KB)
--------manifest-example.json(631B)
--------Success and error status codes.md(4KB)
--------Wrap request body.md(1KB)
--------Client filters.md(5KB)
--------Using remote GraphQL server.md(2KB)
--------The manifest file.md(7KB)
--------Mapping and renaming parameters.md(3KB)
--------Formatting responses.md(2KB)
--------Middleware functions.md(2KB)
--------Generating REST API with init.md(5KB)
--------How parameters are passed.md(2KB)
--------Getting started.md(5KB)
----test()
--------mocks()
--------testUtils.js(900B)
--------unit()
--------test-fixtures()
----yarn.lock(278KB)

网友评论