{"id":13452512,"url":"https://github.com/mstn/apollo-link-swagger","last_synced_at":"2026-02-09T02:09:37.152Z","repository":{"id":137959773,"uuid":"121601033","full_name":"mstn/apollo-link-swagger","owner":"mstn","description":"An ApolloLink for Swagger 2.0 REST endpoints (PoW)","archived":false,"fork":false,"pushed_at":"2018-02-16T05:41:16.000Z","size":44,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-28T18:56:10.847Z","etag":null,"topics":["apollo","apollo-link","graphql","swagger"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mstn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-15T07:13:19.000Z","updated_at":"2024-03-29T04:10:22.000Z","dependencies_parsed_at":"2023-03-22T05:49:38.681Z","dependency_job_id":null,"html_url":"https://github.com/mstn/apollo-link-swagger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstn%2Fapollo-link-swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstn%2Fapollo-link-swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstn%2Fapollo-link-swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstn%2Fapollo-link-swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mstn","download_url":"https://codeload.github.com/mstn/apollo-link-swagger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245159480,"owners_count":20570391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","apollo-link","graphql","swagger"],"created_at":"2024-07-31T07:01:26.211Z","updated_at":"2026-02-09T02:09:37.105Z","avatar_url":"https://github.com/mstn.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003e An ApolloLink for Swagger 2.0 REST endpoints (PoW).\n\n# Apollo Link Swagger (experimental)\n\n[Swagger](https://swagger.io/) is a popular framework for documenting and defining REST APIs.\n\nThis package allows you to use GraphQL with any REST endpoint that has or could have a Swagger spec.\n\nYou do not need a GraphQL server: GraphQL queries are translated into REST queries on the fly directly in your browser.\n\nThis could be useful if you want to migrate your system from REST to GraphQL or if you want to use the goodies of the GraphQL ecosystem with a traditional backend.\n\nA getting started example:\n\n```js\nimport {\n  SwaggerLink,\n  SwaggerSchema\n} from 'apollo-link-swagger';\n\nimport { execute } from 'apollo-link';\n\nimport gql from 'graphql-tag';\n\n// json object shaped as a Swagger schema\nconst schema: SwaggerSchema = { ... };\n\n// build a link\nconst link = new SwaggerLink({ schema });\n\n// execute GraphQL queries against Swagger endpoints\n// the query is translated into an http request\n// i.e. GET https://example.com/sample?id=1\nexecute(link, {\n  query: gql`\n    query SampleQuery {\n      viewer {\n        getSample(id: 1) {\n          hello\n        }\n      }\n    }\n  `\n});\n```\n\n## Alternative and similar projects\n\nYou can use [apollo-link-rest](https://github.com/apollographql/apollo-link-rest). The logic for mapping GraphQL queries to REST is defined by special query directives.\n\nWhile apollo-link-rest might be more useful when you mix data from REST and other datasources, with apollo-link-swagger you do not have to annotate GraphQL queries.\n\n## Help wanted!\n\nThis package is only a proof of work. We need your help to build a solid package! Get in touch.\n\n## Credits\n\nUnder the hood we use [apollo-link-schema](https://www.npmjs.com/package/apollo-link-schema) and\n[swagger-to-graphql](https://github.com/yarax/swagger-to-graphql) (where the hard work is done).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstn%2Fapollo-link-swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmstn%2Fapollo-link-swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstn%2Fapollo-link-swagger/lists"}