An example of using GraphQL to wrap a REST API. An implementation of Apollo Server wrapping the Dog API .
Start by cloning the repository locally. Ensure you have the latest Node and npm.
Install the required dependencies.
$ yarn
Start the development environment.
$ yarn start
Open the playground in your browser http://localhost:4000/
query breedList($breed: String!) {
dogs(breed: $breed) {
breed
imageUrl
}
breed(breed: $breed) {
name
dogs {
breed
imageUrl
}
}
breeds {
dogs {
breed
imageUrl
}
}
}
TypeScript types are generated automatically from GraphQL types. Found in src/generated-schema-types.ts To update this file with type changes run
$ yarn generate-types
Note: Typically generated types shouldn't be commited to repository. This file is being comitted to aid in references this repository.