This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input GPSInput { | |
longitude: Float | |
latitude: Float | |
radius: Float | |
} | |
input AddressInput { | |
street: String | |
city: String | |
state: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Query { | |
me: User! | |
searchForLocation(byGPS: GPSInput, byAddress: AddressInput): LocationPagingConnection | |
} | |
type Mutation { | |
addLocation(location: LocationInput): Location | |
addReview(review: ReviewInput): Review | |
addFavorite(locationId: ID!): Location | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input PagingRequest { | |
limit: Int | |
nextToken: String | |
} | |
type User { | |
id: ID! | |
name: String! | |
email: String | |
locations(paging: PagingRequest): LocationPagingConnection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type User { | |
id: ID! | |
name: String! | |
email: String | |
locations: [Location] | |
reviews: [Review] | |
favorites: [Location] | |
} | |
type Location { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const env = require('process').env; | |
const fetch = require('node-fetch'); | |
const URL = require('url'); | |
const AWS = require('aws-sdk'); | |
AWS.config.update({ | |
region: env.AWS_REGION, | |
credentials: new AWS.Credentials(env.AWS_ACCESS_KEY_ID, env.AWS_SECRET_ACCESS_KEY, env.AWS_SESSION_TOKEN) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider: | |
name : aws | |
region : us-east-1 | |
runtime : nodejs8.10 | |
stage : ${opt:stage, 'dev'} | |
apiname : ${opt:apiname, 'chatql'}_${self:provider.stage} | |
environment: | |
GRAPHQL_API : { Fn::GetAtt: [ GraphQlApi, GraphQLUrl ] } | |
REGION : ${self:provider.region} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2017-02-28", | |
"operation": "PutItem", | |
"key": { | |
"userId": $util.dynamodb.toDynamoDBJson($ctx.args.userId) | |
}, | |
"attributeValues": $util.dynamodb.toMapValuesJson($ctx.args.userDetails) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PostAuthenticationRole: | |
Type : AWS::IAM::Role | |
Properties: | |
RoleName : ${self:provider.apiname}-postauth-lambda | |
AssumeRolePolicyDocument: | |
Version : "2012-10-17" | |
Statement: | |
- Effect : Allow | |
Principal: | |
Service : lambda.amazonaws.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AuthRole: | |
Type : AWS::IAM::Role | |
Description : "Role that the an authenticated user assumes" | |
Properties: | |
RoleName : ${self:provider.apiname}-auth | |
AssumeRolePolicyDocument: | |
Version : "2012-10-17" | |
Statement: | |
- Effect : Allow | |
Principal: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type User { | |
userId: ID! | |
name: String | |
} | |
input UserInput { | |
name: String | |
} | |
type UserPagedConnection { |