Skip to content

Simple sample app using Serverless Application Framework, TypeScript and Apollo GraphQL on AWS. Uses DynamoDB and a REST API based on CrudCrud as data provider.

Notifications You must be signed in to change notification settings

stephledev/serverless-graphql-typescript-example

Repository files navigation

Serverless TypeScript GraphQL Example

Simple sample app using Serverless Application Framework, TypeScript and Apollo GraphQL on AWS.

Uses DynamoDB and a REST API based on CrudCrud as data provider.

Features

Prerequisites

Deploy

  • Run npm install
  • Run npm run deploy

Run locally (with remote DynamoDB)

  • Deploy first (to setup remote DynamoDB)
  • Run npm run offline
  • Go to http://localhost:3000/local/playground and play around

Seed data

Data samples in JSON can be found for DynamoDB and CrudCrud respectively.

Example

query {
  mountainPasses {
    name
    elevation
    length
    maxGradient
    from {
      name
      postalCode
      population
      area
    }
    to {
      name
      postalCode
      population
      area
    }
  }
}
{
  "data": {
    "mountainPasses": [
      {
        "name": "Furka",
        "elevation": 2429,
        "length": 28,
        "maxGradient": 0.11,
        "from": {
          "name": "Realp",
          "postalCode": 6491,
          "population": 153,
          "area": 77.97
        },
        "to": {
          "name": "Oberwald",
          "postalCode": 3999,
          "population": 277,
          "area": 96.9
        }
      },
      {
        "name": "St. Gotthard",
        "elevation": 2107,
        "length": 27,
        "maxGradient": 0.08,
        "from": {
          "name": "Göschenen",
          "postalCode": 6487,
          "population": 448,
          "area": 104.31
        },
        "to": {
          "name": "Airolo",
          "postalCode": 6780,
          "population": 1501,
          "area": 94.5
        }
      }
    ]
  }
}

About

Simple sample app using Serverless Application Framework, TypeScript and Apollo GraphQL on AWS. Uses DynamoDB and a REST API based on CrudCrud as data provider.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published