Skip to content

DurandMathieu/demo-graphql-rest

 
 

Repository files navigation

Apollo Server Example Dog API

An example of using GraphQL to wrap a REST API. An implementation of Apollo Server wrapping the Dog API .

Getting started

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/

Example query

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

$ yarn generate-types

Note: Typically generated types shouldn't be commited to repository. This file is being comitted to aid in references this repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.3%
  • JavaScript 1.7%