Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emilhein/serverless-graphql
A starter project for Graphql made with serverless framework
https://github.com/emilhein/serverless-graphql
graphql nodejs serverless-framework serverless-graphql
Last synced: about 16 hours ago
JSON representation
A starter project for Graphql made with serverless framework
- Host: GitHub
- URL: https://github.com/emilhein/serverless-graphql
- Owner: emilhein
- Created: 2019-08-27T16:15:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T22:24:48.000Z (almost 2 years ago)
- Last Synced: 2024-04-18T09:35:40.765Z (7 months ago)
- Topics: graphql, nodejs, serverless-framework, serverless-graphql
- Language: JavaScript
- Homepage: https://w7lo1gta9h.execute-api.eu-west-1.amazonaws.com/dev/graphql
- Size: 353 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##### Demo: https://w7lo1gta9h.execute-api.eu-west-1.amazonaws.com/dev/graphql
[![Build Status](https://travis-ci.org/emilhein/serverless-graphql.svg?branch=master)](https://travis-ci.org/emilhein/serverless-graphql)
## Get started
This project uses the serverless framework and you should therefore install this globally (and setup credentials if you wish to deploy the project)
Create a file called ".env" in the root of the project and populate it with the following:
```
JWT_SECRET=SOME_RANDOM_SECRET
```To run a local server do the following:
```js
npm install
npm run dev
```## Examples:
```js
query { movies {
title
year
rating
actors {
name
birthday
country
directors {
name
birthday
country
}
}
}
}### NOTE
In other to use the `scoutbase_rating` field you must include a header called "Authorization" with a valid jwt token ("Bearer XXXXX"), that you can recieve by calling the mutations "login" or "createUser"
query {
movies {
scoutbase_rating
title
rating
actors {
name
directors {
country
}
}
}
}mutation {
createUser(username: "user", password: "pass") {
token
user {
id
name
}
}
}mutation {
login(username: "user", password: "pass") {
token
user {
id
name
}
}
}mutation {
addMovie(input: {title: "Superman", year: 2019, rating: "2"}) {
title
}
}```
## Deployment
```
npm run deploy
```