Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jahredhope/apollo-example-dogapi
An example of using GraphQL (Apollo server) to wrap a REST API (Dog API)
https://github.com/jahredhope/apollo-example-dogapi
api
Last synced: 16 days ago
JSON representation
An example of using GraphQL (Apollo server) to wrap a REST API (Dog API)
- Host: GitHub
- URL: https://github.com/jahredhope/apollo-example-dogapi
- Owner: jahredhope
- Created: 2018-08-14T12:36:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T08:07:31.000Z (over 2 years ago)
- Last Synced: 2024-10-19T02:00:28.389Z (29 days ago)
- Topics: api
- Language: TypeScript
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apollo Server Example Dog API
An example of using [GraphQL](https://graphql.org/) to wrap a [REST API](https://en.wikipedia.org/wiki/Representational_state_transfer).
An implementation of Apollo Server wrapping the [Dog API ](https://dog.ceo/dog-api/).## Getting started
Start by cloning the repository locally.
Ensure you have the latest [Node and npm](https://nodejs.org/en/).Install the required dependencies.
```bash
$ yarn
```Start the development environment.
```bash
$ yarn start
```Open the playground in your browser [http://localhost:4000/](http://localhost:4000/)
## Example query
```GraphQL
query breedList($breed: String!) {
dogs(breed: $breed) {
breed
imageUrl
}
breed(breed: $breed) {
name
dogs {
breed
imageUrl
}
}
breeds {
dogs {
breed
imageUrl
}
}
}
```## TypeScript type generation from GraphQL types
TypeScript types are generated automatically from GraphQL types.
Found in **src/generated-schema-types.ts**
To update this file with type changes run```bash
$ yarn generate-types
```**Note:** Typically generated types shouldn't be commited to repository. This file is being comitted to aid in references this repository.