Skip to content

Commit

Permalink
Fix links
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Cha <[email protected]>
  • Loading branch information
Alan-Cha authored and ErikWittern committed Jun 20, 2019
1 parent 4f1e88d commit c2f51da
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
![GitHub last commit](https://img.shields.io/github/last-commit/strongloop/oasgraph.svg?style=flat)
![GitHub last commit](https://img.shields.io/github/last-commit/ibm/openapi-to-graphql.svg?style=flat)
![Travis (.org)](https://img.shields.io/travis/ibm/openapi-to-graphql.svg?style=flat)
[![Join the chat at https://gitter.im/IBM/openapi-to-graphql](https://badges.gitter.im/IBM/openapi-to-graphql.svg?style=flat)](https://gitter.im/IBM/openapi-to-graphql?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# OpenAPI-to-GraphQL

Translate APIs described by [OpenAPI Specifications (OAS)](https://github.com/OAI/OpenAPI-Specification) or [Swagger](https://swagger.io/specification/v2/) into [GraphQL](https://graphql.org/).

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/translation.png" alt="Overview of translation" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/translation.png" alt="Overview of translation" width="600">

## Getting started

Expand Down Expand Up @@ -57,32 +57,32 @@ Here are some guides to further help you get started:
- **Data-centric**
The GraphQL interface is created around the data definitions in the given OAS, not around the endpoints, leading to a natural use of GraphQL.

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/data-centric.png" alt="Example of data-centric design" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/data-centric.png" alt="Example of data-centric design" width="600">

- **Nested data**
[Links](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md#linksObject) defined in the OAS are used to compose data definitions. Furthermore, hierarchical path structures can be used to nest data via the [`addSubOperations`](./packages/openapi-to-graphql/README.md#options-addsuboperations) option.

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/links.png" alt="Example of links resolution" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/links.png" alt="Example of links resolution" width="600">

- **Automatic query resolution**
Automatically generated resolvers translate (nested) GraphQL queries to API requests. Request results are translated back to GraphQL responses.

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/resolution.png" alt="Example of query resolution" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/resolution.png" alt="Example of query resolution" width="600">

- **Mutations**
Non-safe, non-idempotent API operations (e.g., `POST`, `PUT`, `DELETE`) are translated to GraphQL [mutations](http://graphql.org/learn/queries/#mutations). Input payload is type-checked.

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/mutations.png" alt="Example of mutation" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/mutations.png" alt="Example of mutation" width="600">

- **Authentication**
OpenAPI-to-GraphQL currently supports authentication via API Key and basic auth. OpenAPI-to-GraphQL wraps secured endpoints into a `viewer`, which takes the API key / credentials as input.

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/auth.png" alt="Example of authentication" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/auth.png" alt="Example of authentication" width="600">

- **API Sanitation**
Parts of an API that not compatible with GraphQL are automatically sanitized. For example, API parameters and data definition names with unsupported characters (e.g., `-`, `.`, `,`, `:`, `;`...) are removed. GraphQL queries are desanitized to correctly invoke the REST API and the responses are resanitized to create GraphQL-compliant results.

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/sanitization.png" alt="Example of sanitation" width="300">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/sanitization.png" alt="Example of sanitation" width="300">

- **Custom request options** Provide headers and query parameters to send with every API request. This allows, for example, to handle authentication or tag requests from GraphQL.

Expand Down
8 changes: 4 additions & 4 deletions packages/openapi-to-graphql-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

Command line interface (CLI) for turning APIs described by [OpenAPI Specification (OAS)](https://github.com/OAI/OpenAPI-Specification) into [GraphQL](https://graphql.org/) interfaces.

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/translation.png" alt="Overview of translation" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/translation.png" alt="Overview of translation" width="600">

_Note: To use OpenAPI-to-GraphQL as a library, refer to the [`openapi-to-graphql`](https://github.com/strongloop/oasgraph/tree/openapi-to-graphql/packages/openapi-to-graphql) package._
_Note: To use OpenAPI-to-GraphQL as a library, refer to the [`openapi-to-graphql`](https://github.com/IBM/openapi-to-graphql/tree/master/packages/openapi-to-graphql) package._

## Installation

Expand Down Expand Up @@ -66,9 +66,9 @@ openapi-to-graphql oas.json --save schema.graphql

---

To learn more about the other options, please refer [here](https://github.com/strongloop/oasgraph/tree/openapi-to-graphql/packages/openapi-to-graphql#options).
To learn more about the other options, please refer [here](https://github.com/IBM/openapi-to-graphql/tree/master/packages/openapi-to-graphql#options).

Please note that the CLI tool is mainly used for quick testing and does not offer all the features that [`createGraphQlSchema(oas, options)`](https://github.com/strongloop/oasgraph/tree/openapi-to-graphql/packages/openapi-to-graphql#usage) does.
Please note that the CLI tool is mainly used for quick testing and does not offer all the features that [`createGraphQlSchema(oas, options)`](https://github.com/IBM/openapi-to-graphql/tree/master/packages/openapi-to-graphql#usage) does.

## License

Expand Down
4 changes: 2 additions & 2 deletions packages/openapi-to-graphql-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
},
"repository": {
"type": "git",
"url": "https://github.com/strongloop/oasgraph/tree/openapi-to-graphql"
"url": "https://github.com/ibm/openapi-to-graphql"
},
"homepage": "https://github.com/strongloop/oasgraph/blob/openapi-to-graphql/README.md",
"homepage": "https://github.com/ibm/openapi-to-graphql",
"keywords": [
"ibm",
"strongloop",
Expand Down
4 changes: 2 additions & 2 deletions packages/openapi-to-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

Generates a [GraphQL schema](https://graphql.org/learn/schema/) for a given [OpenAPI Specification (OAS)](https://github.com/OAI/OpenAPI-Specification).

<img src="https://raw.githubusercontent.com/strongloop/oasgraph/openapi-to-graphql/docs/translation.png" alt="Overview of translation" width="600">
<img src="https://raw.githubusercontent.com/ibm/openapi-to-graphql/master/docs/translation.png" alt="Overview of translation" width="600">

_Note: To use OpenAPI-to-GraphQL via the command line, refer to the [`openapi-to-graphql-cli`](https://github.com/strongloop/oasgraph/tree/openapi-to-graphql/packages/openapi-to-graphql-cli) package._
_Note: To use OpenAPI-to-GraphQL via the command line, refer to the [`openapi-to-graphql-cli`](https://github.com/IBM/openapi-to-graphql/tree/master/packages/openapi-to-graphql-cli) package._

## Installation

Expand Down
4 changes: 2 additions & 2 deletions packages/openapi-to-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
},
"repository": {
"type": "git",
"url": "https://github.com/strongloop/oasgraph/tree/openapi-to-graphql"
"url": "https://github.com/ibm/openapi-to-graphql"
},
"homepage": "https://github.com/strongloop/oasgraph/blob/openapi-to-graphql/README.md",
"homepage": "https://github.com/ibm/openapi-to-graphql",
"keywords": [
"ibm",
"strongloop",
Expand Down

0 comments on commit c2f51da

Please sign in to comment.