├── .env ├── .env.copy ├── .gitignore ├── README.md ├── config.yaml.copy ├── functions ├── cognito-triggers │ └── pre-token-generation.js ├── event-triggers │ └── index.js └── remote-schema │ ├── index.js │ ├── mutations │ ├── index.js │ └── signUp.js │ ├── package-lock.json │ ├── package.json │ ├── queries │ ├── index.js │ └── signIn.js │ └── types │ ├── AuthResult.js │ ├── index.js │ ├── mutation.js │ └── query.js ├── migrations ├── .gitkeep └── 1588020261196_create_remote_schema_remote-schema │ ├── down.yaml │ └── up.yaml ├── package-lock.json ├── package.json ├── resources ├── cloudfront.yml ├── cognito.yml ├── ecs.yml ├── elb.yml ├── rds.yml └── vpc.yml └── serverless.yml /.env: -------------------------------------------------------------------------------- 1 | HASURA_ADMIN_SECRET=tempestpass 2 | DATABASE_USERNAME=tempest 3 | DATABASE_PASSWORD=123456789 -------------------------------------------------------------------------------- /.env.copy: -------------------------------------------------------------------------------- 1 | HASURA_ADMIN_SECRET= 2 | DATABASE_USERNAME= 3 | DATABASE_PASSWORD= -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # package directories 2 | node_modules 3 | jspm_packages 4 | 5 | # Serverless directories 6 | .serverless 7 | 8 | # Hasura files 9 | config.yaml 10 | 11 | # Mac 12 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GraphQL API boilerplate based on Hasura + AWS using the Serverless Framework 2 | 3 | Fully scripted GraphQL API boilerplate based on Hasura + AWS using the Serverless Framework. 4 | 5 | Tutorial on https://medium.com/@reynaldojesus23/serverless-graphql-api-with-hasura-and-aws-stack-614d4392d8a 6 | -------------------------------------------------------------------------------- /config.yaml.copy: -------------------------------------------------------------------------------- 1 | admin_secret: 2 | endpoint: https:// -------------------------------------------------------------------------------- /functions/cognito-triggers/pre-token-generation.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports.handler = (event, context, callback) => { 4 | event.response = { 5 | claimsOverrideDetails: { 6 | claimsToAddOrOverride: { 7 | 'https://hasura.io/jwt/claims': JSON.stringify({ 8 | 'x-hasura-allowed-roles': ['anonymous', 'user'], 9 | 'x-hasura-default-role': 'user', 10 | 'x-hasura-user-id': event.request.userAttributes.sub 11 | }) 12 | } 13 | } 14 | }; 15 | 16 | callback(null, event); 17 | }; 18 | -------------------------------------------------------------------------------- /functions/event-triggers/index.js: -------------------------------------------------------------------------------- 1 | // Import and use function to handle each trigger (by trigger name) on operation 2 | 3 | const triggersHandle = { 4 | INSERT: { 5 | 6 | }, 7 | UPDATE: { 8 | 9 | }, 10 | DELETE: { 11 | 12 | } 13 | }; 14 | 15 | exports.handler = async args => { 16 | const body = JSON.parse(args.body); 17 | const { 18 | event: { 19 | op, 20 | data: { old: oldData, new: newData } 21 | }, 22 | table 23 | } = body; 24 | 25 | if (triggersHandle[op] && triggersHandle[op][table.name]) { 26 | return triggersHandle[op][table.name](newData, oldData).then(() => { 27 | return { 28 | statusCode: 200, 29 | body: 'success', 30 | }; 31 | }).catch((error) => { 32 | console.log('error', error); 33 | return { 34 | statusCode: 404, 35 | body: error 36 | }; 37 | }); 38 | } else { 39 | return { 40 | statusCode: 404, 41 | body: 'No trigger associated' 42 | }; 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /functions/remote-schema/index.js: -------------------------------------------------------------------------------- 1 | const { ApolloServer, gql } = require('apollo-server-lambda'); 2 | 3 | // Construct a schema, using GraphQL schema language 4 | const typeDefs = gql` 5 | ${require('./types').types} 6 | `; 7 | 8 | // Provide resolver functions for your schema fields 9 | const resolvers = { 10 | Query: { 11 | ...require('./queries').queries 12 | }, 13 | Mutation: { 14 | ...require('./mutations').mutations 15 | } 16 | }; 17 | 18 | const server = new ApolloServer({ 19 | typeDefs, 20 | resolvers, 21 | context: ({ event, context }) => ({ 22 | headers: event.headers, 23 | functionName: context.functionName, 24 | event, 25 | context, 26 | }), 27 | }); 28 | 29 | exports.handler = server.createHandler({ 30 | cors: { 31 | origin: '*', 32 | credentials: true, 33 | }, 34 | }); 35 | -------------------------------------------------------------------------------- /functions/remote-schema/mutations/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const mutations = fs.readdirSync('./functions/remote-schema/mutations') 4 | .reduce((p, f) => { 5 | if (f === 'index.js') return p; 6 | p[f.replace('.js', '')] = require(`./${f}`).default; 7 | return p; 8 | }, 9 | {} 10 | ); 11 | 12 | exports.mutations = mutations; 13 | -------------------------------------------------------------------------------- /functions/remote-schema/mutations/signUp.js: -------------------------------------------------------------------------------- 1 | const AWS = require('aws-sdk'); 2 | const apollo = require('apollo-server-lambda'); 3 | 4 | const cognitoIdentityServiceProvider = new AWS.CognitoIdentityServiceProvider(); 5 | 6 | const signUp = async (parent, args) => { 7 | const { email, password } = args; 8 | if (!email || !password) { 9 | throw new apollo.UserInputError('You must specify the email and password'); 10 | } 11 | 12 | return cognitoIdentityServiceProvider.signUp({ 13 | Username: email, 14 | Password: password, 15 | ClientId: process.env.COGNITO_CLIENT_ID, 16 | }).promise().then(() => 'Signed up successfully, please check your email') 17 | .catch((error) => { 18 | throw new apollo.AuthenticationError(error.message) 19 | }); 20 | }; 21 | 22 | exports.default = signUp; 23 | -------------------------------------------------------------------------------- /functions/remote-schema/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "remote-schema", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@apollo/protobufjs": { 8 | "version": "1.0.3", 9 | "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.0.3.tgz", 10 | "integrity": "sha512-gqeT810Ect9WIqsrgfUvr+ljSB5m1PyBae9HGdrRyQ3HjHjTcjVvxpsMYXlUk4rUHnrfUqyoGvLSy2yLlRGEOw==", 11 | "requires": { 12 | "@protobufjs/aspromise": "^1.1.2", 13 | "@protobufjs/base64": "^1.1.2", 14 | "@protobufjs/codegen": "^2.0.4", 15 | "@protobufjs/eventemitter": "^1.1.0", 16 | "@protobufjs/fetch": "^1.1.0", 17 | "@protobufjs/float": "^1.0.2", 18 | "@protobufjs/inquire": "^1.1.0", 19 | "@protobufjs/path": "^1.1.2", 20 | "@protobufjs/pool": "^1.1.0", 21 | "@protobufjs/utf8": "^1.1.0", 22 | "@types/long": "^4.0.0", 23 | "@types/node": "^10.1.0", 24 | "long": "^4.0.0" 25 | }, 26 | "dependencies": { 27 | "@types/node": { 28 | "version": "10.17.20", 29 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.20.tgz", 30 | "integrity": "sha512-XgDgo6W10SeGEAM0k7FosJpvLCynOTYns4Xk3J5HGrA+UI/bKZ30PGMzOP5Lh2zs4259I71FSYLAtjnx3qhObw==" 31 | } 32 | } 33 | }, 34 | "@apollographql/apollo-tools": { 35 | "version": "0.4.5", 36 | "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.4.5.tgz", 37 | "integrity": "sha512-KOZC4Y+JM4iQQ7P4CVC878Ee7ya0QoHApGHu4klwjwZkYyOdWIvbML7JfXOUb/AfCO4DFmJfHCjRdAX09Ga6sQ==", 38 | "requires": { 39 | "apollo-env": "^0.6.2" 40 | } 41 | }, 42 | "@apollographql/graphql-playground-html": { 43 | "version": "1.6.24", 44 | "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.24.tgz", 45 | "integrity": "sha512-8GqG48m1XqyXh4mIZrtB5xOhUwSsh1WsrrsaZQOEYYql3YN9DEu9OOSg0ILzXHZo/h2Q74777YE4YzlArQzQEQ==" 46 | }, 47 | "@protobufjs/aspromise": { 48 | "version": "1.1.2", 49 | "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", 50 | "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" 51 | }, 52 | "@protobufjs/base64": { 53 | "version": "1.1.2", 54 | "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", 55 | "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" 56 | }, 57 | "@protobufjs/codegen": { 58 | "version": "2.0.4", 59 | "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", 60 | "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" 61 | }, 62 | "@protobufjs/eventemitter": { 63 | "version": "1.1.0", 64 | "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", 65 | "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" 66 | }, 67 | "@protobufjs/fetch": { 68 | "version": "1.1.0", 69 | "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", 70 | "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", 71 | "requires": { 72 | "@protobufjs/aspromise": "^1.1.1", 73 | "@protobufjs/inquire": "^1.1.0" 74 | } 75 | }, 76 | "@protobufjs/float": { 77 | "version": "1.0.2", 78 | "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", 79 | "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" 80 | }, 81 | "@protobufjs/inquire": { 82 | "version": "1.1.0", 83 | "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", 84 | "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" 85 | }, 86 | "@protobufjs/path": { 87 | "version": "1.1.2", 88 | "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", 89 | "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" 90 | }, 91 | "@protobufjs/pool": { 92 | "version": "1.1.0", 93 | "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", 94 | "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" 95 | }, 96 | "@protobufjs/utf8": { 97 | "version": "1.1.0", 98 | "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", 99 | "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" 100 | }, 101 | "@types/accepts": { 102 | "version": "1.3.5", 103 | "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", 104 | "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", 105 | "requires": { 106 | "@types/node": "*" 107 | } 108 | }, 109 | "@types/aws-lambda": { 110 | "version": "8.10.50", 111 | "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.50.tgz", 112 | "integrity": "sha512-RDzmQ5mO1f0BViKiuOudENZmoCACEa461nTRVtxhsAiEqGCgwdhCYN0aFgk42X5+ELAiqJKbv2mK0LkopYRYQg==" 113 | }, 114 | "@types/body-parser": { 115 | "version": "1.19.0", 116 | "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", 117 | "integrity": "sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ==", 118 | "requires": { 119 | "@types/connect": "*", 120 | "@types/node": "*" 121 | } 122 | }, 123 | "@types/connect": { 124 | "version": "3.4.33", 125 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", 126 | "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", 127 | "requires": { 128 | "@types/node": "*" 129 | } 130 | }, 131 | "@types/content-disposition": { 132 | "version": "0.5.3", 133 | "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz", 134 | "integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg==" 135 | }, 136 | "@types/cookies": { 137 | "version": "0.7.4", 138 | "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.4.tgz", 139 | "integrity": "sha512-oTGtMzZZAVuEjTwCjIh8T8FrC8n/uwy+PG0yTvQcdZ7etoel7C7/3MSd7qrukENTgQtotG7gvBlBojuVs7X5rw==", 140 | "requires": { 141 | "@types/connect": "*", 142 | "@types/express": "*", 143 | "@types/keygrip": "*", 144 | "@types/node": "*" 145 | } 146 | }, 147 | "@types/express": { 148 | "version": "4.17.6", 149 | "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.6.tgz", 150 | "integrity": "sha512-n/mr9tZI83kd4azlPG5y997C/M4DNABK9yErhFM6hKdym4kkmd9j0vtsJyjFIwfRBxtrxZtAfGZCNRIBMFLK5w==", 151 | "requires": { 152 | "@types/body-parser": "*", 153 | "@types/express-serve-static-core": "*", 154 | "@types/qs": "*", 155 | "@types/serve-static": "*" 156 | } 157 | }, 158 | "@types/express-serve-static-core": { 159 | "version": "4.17.5", 160 | "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.5.tgz", 161 | "integrity": "sha512-578YH5Lt88AKoADy0b2jQGwJtrBxezXtVe/MBqWXKZpqx91SnC0pVkVCcxcytz3lWW+cHBYDi3Ysh0WXc+rAYw==", 162 | "requires": { 163 | "@types/node": "*", 164 | "@types/range-parser": "*" 165 | } 166 | }, 167 | "@types/fs-capacitor": { 168 | "version": "2.0.0", 169 | "resolved": "https://registry.npmjs.org/@types/fs-capacitor/-/fs-capacitor-2.0.0.tgz", 170 | "integrity": "sha512-FKVPOCFbhCvZxpVAMhdBdTfVfXUpsh15wFHgqOKxh9N9vzWZVuWCSijZ5T4U34XYNnuj2oduh6xcs1i+LPI+BQ==", 171 | "requires": { 172 | "@types/node": "*" 173 | } 174 | }, 175 | "@types/graphql-upload": { 176 | "version": "8.0.3", 177 | "resolved": "https://registry.npmjs.org/@types/graphql-upload/-/graphql-upload-8.0.3.tgz", 178 | "integrity": "sha512-hmLg9pCU/GmxBscg8GCr1vmSoEmbItNNxdD5YH2TJkXm//8atjwuprB+xJBK714JG1dkxbbhp5RHX+Pz1KsCMA==", 179 | "requires": { 180 | "@types/express": "*", 181 | "@types/fs-capacitor": "*", 182 | "@types/koa": "*", 183 | "graphql": "^14.5.3" 184 | }, 185 | "dependencies": { 186 | "graphql": { 187 | "version": "14.6.0", 188 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.6.0.tgz", 189 | "integrity": "sha512-VKzfvHEKybTKjQVpTFrA5yUq2S9ihcZvfJAtsDBBCuV6wauPu1xl/f9ehgVf0FcEJJs4vz6ysb/ZMkGigQZseg==", 190 | "requires": { 191 | "iterall": "^1.2.2" 192 | } 193 | } 194 | } 195 | }, 196 | "@types/http-assert": { 197 | "version": "1.5.1", 198 | "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz", 199 | "integrity": "sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ==" 200 | }, 201 | "@types/keygrip": { 202 | "version": "1.0.2", 203 | "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz", 204 | "integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==" 205 | }, 206 | "@types/koa": { 207 | "version": "2.11.3", 208 | "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.11.3.tgz", 209 | "integrity": "sha512-ABxVkrNWa4O/Jp24EYI/hRNqEVRlhB9g09p48neQp4m3xL1TJtdWk2NyNQSMCU45ejeELMQZBYyfstyVvO2H3Q==", 210 | "requires": { 211 | "@types/accepts": "*", 212 | "@types/content-disposition": "*", 213 | "@types/cookies": "*", 214 | "@types/http-assert": "*", 215 | "@types/keygrip": "*", 216 | "@types/koa-compose": "*", 217 | "@types/node": "*" 218 | } 219 | }, 220 | "@types/koa-compose": { 221 | "version": "3.2.5", 222 | "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz", 223 | "integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==", 224 | "requires": { 225 | "@types/koa": "*" 226 | } 227 | }, 228 | "@types/long": { 229 | "version": "4.0.1", 230 | "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", 231 | "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" 232 | }, 233 | "@types/mime": { 234 | "version": "2.0.1", 235 | "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", 236 | "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" 237 | }, 238 | "@types/node": { 239 | "version": "13.13.1", 240 | "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.1.tgz", 241 | "integrity": "sha512-uysqysLJ+As9jqI5yqjwP3QJrhOcUwBjHUlUxPxjbplwKoILvXVsmYWEhfmAQlrPfbRZmhJB007o4L9sKqtHqQ==" 242 | }, 243 | "@types/node-fetch": { 244 | "version": "2.5.5", 245 | "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.5.tgz", 246 | "integrity": "sha512-IWwjsyYjGw+em3xTvWVQi5MgYKbRs0du57klfTaZkv/B24AEQ/p/IopNeqIYNy3EsfHOpg8ieQSDomPcsYMHpA==", 247 | "requires": { 248 | "@types/node": "*", 249 | "form-data": "^3.0.0" 250 | } 251 | }, 252 | "@types/qs": { 253 | "version": "6.9.1", 254 | "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.1.tgz", 255 | "integrity": "sha512-lhbQXx9HKZAPgBkISrBcmAcMpZsmpe/Cd/hY7LGZS5OfkySUBItnPZHgQPssWYUET8elF+yCFBbP1Q0RZPTdaw==" 256 | }, 257 | "@types/range-parser": { 258 | "version": "1.2.3", 259 | "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", 260 | "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" 261 | }, 262 | "@types/serve-static": { 263 | "version": "1.13.3", 264 | "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz", 265 | "integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==", 266 | "requires": { 267 | "@types/express-serve-static-core": "*", 268 | "@types/mime": "*" 269 | } 270 | }, 271 | "@types/ws": { 272 | "version": "6.0.4", 273 | "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.4.tgz", 274 | "integrity": "sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg==", 275 | "requires": { 276 | "@types/node": "*" 277 | } 278 | }, 279 | "@wry/equality": { 280 | "version": "0.1.11", 281 | "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", 282 | "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", 283 | "requires": { 284 | "tslib": "^1.9.3" 285 | } 286 | }, 287 | "apollo-cache-control": { 288 | "version": "0.9.1", 289 | "resolved": "https://registry.npmjs.org/apollo-cache-control/-/apollo-cache-control-0.9.1.tgz", 290 | "integrity": "sha512-9t2EcRevUrANuGhF5XUbKJEfnc6Jy2Rn7Y8nOIKlsEEC+AX7Ko4svWYTyyTxj0h0RXfiegY2nbz4sVry/pS3rA==", 291 | "requires": { 292 | "apollo-server-env": "^2.4.3", 293 | "graphql-extensions": "^0.11.1" 294 | } 295 | }, 296 | "apollo-datasource": { 297 | "version": "0.7.0", 298 | "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-0.7.0.tgz", 299 | "integrity": "sha512-Yja12BgNQhzuFGG/5Nw2MQe0hkuQy2+9er09HxeEyAf2rUDIPnhPrn1MDoZTB8MU7UGfjwITC+1ofzKkkrZobA==", 300 | "requires": { 301 | "apollo-server-caching": "^0.5.1", 302 | "apollo-server-env": "^2.4.3" 303 | } 304 | }, 305 | "apollo-engine-reporting": { 306 | "version": "1.7.1", 307 | "resolved": "https://registry.npmjs.org/apollo-engine-reporting/-/apollo-engine-reporting-1.7.1.tgz", 308 | "integrity": "sha512-9ykddPxlC95R9CkkJaPaGriRbOGfzeKqqPXRAunyX1h4sG/8g+MJ/gGzmnNf63k6RvRUdRENCE83wPk2OeU+2A==", 309 | "requires": { 310 | "apollo-engine-reporting-protobuf": "^0.4.4", 311 | "apollo-graphql": "^0.4.0", 312 | "apollo-server-caching": "^0.5.1", 313 | "apollo-server-env": "^2.4.3", 314 | "apollo-server-errors": "^2.4.1", 315 | "apollo-server-types": "^0.3.1", 316 | "async-retry": "^1.2.1", 317 | "graphql-extensions": "^0.11.1" 318 | } 319 | }, 320 | "apollo-engine-reporting-protobuf": { 321 | "version": "0.4.4", 322 | "resolved": "https://registry.npmjs.org/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.4.4.tgz", 323 | "integrity": "sha512-SGrIkUR7Q/VjU8YG98xcvo340C4DaNUhg/TXOtGsMlfiJDzHwVau/Bv6zifAzBafp2lj0XND6Daj5kyT/eSI/w==", 324 | "requires": { 325 | "@apollo/protobufjs": "^1.0.3" 326 | } 327 | }, 328 | "apollo-env": { 329 | "version": "0.6.2", 330 | "resolved": "https://registry.npmjs.org/apollo-env/-/apollo-env-0.6.2.tgz", 331 | "integrity": "sha512-Vb/doL1ZbzkNDJCQ6kYGOrphRx63rMERYo3MT2pzm2pNEdm6AK60InMgJaeh3RLK3cjGllOXFAgP8IY+m+TaEg==", 332 | "requires": { 333 | "@types/node-fetch": "2.5.5", 334 | "core-js": "^3.0.1", 335 | "node-fetch": "^2.2.0", 336 | "sha.js": "^2.4.11" 337 | } 338 | }, 339 | "apollo-graphql": { 340 | "version": "0.4.1", 341 | "resolved": "https://registry.npmjs.org/apollo-graphql/-/apollo-graphql-0.4.1.tgz", 342 | "integrity": "sha512-dz2wtGeCqUDAKAj4KXLKLZiFY791aoXduul3KcLo8/6SwqWlsuZiPe0oB8mENHZZc/EchCpTMTJZX2ZENsOt2A==", 343 | "requires": { 344 | "apollo-env": "^0.6.2", 345 | "lodash.sortby": "^4.7.0" 346 | } 347 | }, 348 | "apollo-link": { 349 | "version": "1.2.14", 350 | "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", 351 | "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", 352 | "requires": { 353 | "apollo-utilities": "^1.3.0", 354 | "ts-invariant": "^0.4.0", 355 | "tslib": "^1.9.3", 356 | "zen-observable-ts": "^0.8.21" 357 | } 358 | }, 359 | "apollo-server-caching": { 360 | "version": "0.5.1", 361 | "resolved": "https://registry.npmjs.org/apollo-server-caching/-/apollo-server-caching-0.5.1.tgz", 362 | "integrity": "sha512-L7LHZ3k9Ao5OSf2WStvQhxdsNVplRQi7kCAPfqf9Z3GBEnQ2uaL0EgO0hSmtVHfXTbk5CTRziMT1Pe87bXrFIw==", 363 | "requires": { 364 | "lru-cache": "^5.0.0" 365 | } 366 | }, 367 | "apollo-server-core": { 368 | "version": "2.12.0", 369 | "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.12.0.tgz", 370 | "integrity": "sha512-BRVdOyZrRJ1ALlmis0vaOLIHHYu5K3UVKAQKIgHkRh/YY0Av4lpeEXr49ELK04LTeh0DG0pQ5YYYhaX1wFcDEw==", 371 | "requires": { 372 | "@apollographql/apollo-tools": "^0.4.3", 373 | "@apollographql/graphql-playground-html": "1.6.24", 374 | "@types/graphql-upload": "^8.0.0", 375 | "@types/ws": "^6.0.0", 376 | "apollo-cache-control": "^0.9.1", 377 | "apollo-datasource": "^0.7.0", 378 | "apollo-engine-reporting": "^1.7.1", 379 | "apollo-server-caching": "^0.5.1", 380 | "apollo-server-env": "^2.4.3", 381 | "apollo-server-errors": "^2.4.1", 382 | "apollo-server-plugin-base": "^0.7.1", 383 | "apollo-server-types": "^0.3.1", 384 | "apollo-tracing": "^0.9.1", 385 | "fast-json-stable-stringify": "^2.0.0", 386 | "graphql-extensions": "^0.11.1", 387 | "graphql-tag": "^2.9.2", 388 | "graphql-tools": "^4.0.0", 389 | "graphql-upload": "^8.0.2", 390 | "loglevel": "^1.6.7", 391 | "sha.js": "^2.4.11", 392 | "subscriptions-transport-ws": "^0.9.11", 393 | "ws": "^6.0.0" 394 | } 395 | }, 396 | "apollo-server-env": { 397 | "version": "2.4.3", 398 | "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-2.4.3.tgz", 399 | "integrity": "sha512-23R5Xo9OMYX0iyTu2/qT0EUb+AULCBriA9w8HDfMoChB8M+lFClqUkYtaTTHDfp6eoARLW8kDBhPOBavsvKAjA==", 400 | "requires": { 401 | "node-fetch": "^2.1.2", 402 | "util.promisify": "^1.0.0" 403 | } 404 | }, 405 | "apollo-server-errors": { 406 | "version": "2.4.1", 407 | "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-2.4.1.tgz", 408 | "integrity": "sha512-7oEd6pUxqyWYUbQ9TA8tM0NU/3aGtXSEibo6+txUkuHe7QaxfZ2wHRp+pfT1LC1K3RXYjKj61/C2xEO19s3Kdg==" 409 | }, 410 | "apollo-server-lambda": { 411 | "version": "2.12.0", 412 | "resolved": "https://registry.npmjs.org/apollo-server-lambda/-/apollo-server-lambda-2.12.0.tgz", 413 | "integrity": "sha512-yQU1DoYcyiMpcrJJc+TbjqVUBbSXB6Ch2d5vowQSZxLSE5zqzyFDUQLwHwGw1GzghOF2jauaVRt31l/TKy0qOQ==", 414 | "requires": { 415 | "@apollographql/graphql-playground-html": "1.6.24", 416 | "@types/aws-lambda": "^8.10.31", 417 | "apollo-server-core": "^2.12.0", 418 | "apollo-server-env": "^2.4.3", 419 | "apollo-server-types": "^0.3.1", 420 | "graphql-tools": "^4.0.0" 421 | } 422 | }, 423 | "apollo-server-plugin-base": { 424 | "version": "0.7.1", 425 | "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-0.7.1.tgz", 426 | "integrity": "sha512-PRavvoWq7/Xufqc+qkDQg3Aqueq4QrPBFfoCFIjhkJ4n2d2YoqE3gTGccb8YoWusfa62ASMn6R47OdNuVtEbXw==", 427 | "requires": { 428 | "apollo-server-types": "^0.3.1" 429 | } 430 | }, 431 | "apollo-server-types": { 432 | "version": "0.3.1", 433 | "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-0.3.1.tgz", 434 | "integrity": "sha512-6nX5VC3icOGf1RZIs7/SYQZff+Cl16LQu1FHUOIk9gAMN2XjlRCyJgCeMj5YHJzQ8Mhg4BO0weWuydEg+JxLzg==", 435 | "requires": { 436 | "apollo-engine-reporting-protobuf": "^0.4.4", 437 | "apollo-server-caching": "^0.5.1", 438 | "apollo-server-env": "^2.4.3" 439 | } 440 | }, 441 | "apollo-tracing": { 442 | "version": "0.9.1", 443 | "resolved": "https://registry.npmjs.org/apollo-tracing/-/apollo-tracing-0.9.1.tgz", 444 | "integrity": "sha512-4wVNM6rc70XhwWxuDWrMBLaHA8NjB9pUS2sNpddQvP36ZtQfsa08XLSUxGAZT+bej+TzW26hKNtuO31RgqC9Hg==", 445 | "requires": { 446 | "apollo-server-env": "^2.4.3", 447 | "graphql-extensions": "^0.11.1" 448 | } 449 | }, 450 | "apollo-utilities": { 451 | "version": "1.3.3", 452 | "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.3.tgz", 453 | "integrity": "sha512-F14aX2R/fKNYMvhuP2t9GD9fggID7zp5I96MF5QeKYWDWTrkRdHRp4+SVfXUVN+cXOaB/IebfvRtzPf25CM0zw==", 454 | "requires": { 455 | "@wry/equality": "^0.1.2", 456 | "fast-json-stable-stringify": "^2.0.0", 457 | "ts-invariant": "^0.4.0", 458 | "tslib": "^1.10.0" 459 | } 460 | }, 461 | "async-limiter": { 462 | "version": "1.0.1", 463 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", 464 | "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" 465 | }, 466 | "async-retry": { 467 | "version": "1.3.1", 468 | "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.1.tgz", 469 | "integrity": "sha512-aiieFW/7h3hY0Bq5d+ktDBejxuwR78vRu9hDUdR8rNhSaQ29VzPL4AoIRG7D/c7tdenwOcKvgPM6tIxB3cB6HA==", 470 | "requires": { 471 | "retry": "0.12.0" 472 | } 473 | }, 474 | "asynckit": { 475 | "version": "0.4.0", 476 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 477 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 478 | }, 479 | "aws-sdk": { 480 | "version": "2.659.0", 481 | "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.659.0.tgz", 482 | "integrity": "sha512-gtMIHS0BL/ckq6tm6NpeJhI6+GIXI0YrDVkpbHP2lfazsno9TgRyGI/P19QOa8tWaAujgw+GustTtZCEi0LVDA==", 483 | "dev": true, 484 | "requires": { 485 | "buffer": "4.9.1", 486 | "events": "1.1.1", 487 | "ieee754": "1.1.13", 488 | "jmespath": "0.15.0", 489 | "querystring": "0.2.0", 490 | "sax": "1.2.1", 491 | "url": "0.10.3", 492 | "uuid": "3.3.2", 493 | "xml2js": "0.4.19" 494 | }, 495 | "dependencies": { 496 | "uuid": { 497 | "version": "3.3.2", 498 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 499 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", 500 | "dev": true 501 | } 502 | } 503 | }, 504 | "backo2": { 505 | "version": "1.0.2", 506 | "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", 507 | "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" 508 | }, 509 | "base64-js": { 510 | "version": "1.3.1", 511 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", 512 | "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", 513 | "dev": true 514 | }, 515 | "buffer": { 516 | "version": "4.9.1", 517 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", 518 | "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", 519 | "dev": true, 520 | "requires": { 521 | "base64-js": "^1.0.2", 522 | "ieee754": "^1.1.4", 523 | "isarray": "^1.0.0" 524 | } 525 | }, 526 | "busboy": { 527 | "version": "0.3.1", 528 | "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.3.1.tgz", 529 | "integrity": "sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw==", 530 | "requires": { 531 | "dicer": "0.3.0" 532 | } 533 | }, 534 | "combined-stream": { 535 | "version": "1.0.8", 536 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 537 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 538 | "requires": { 539 | "delayed-stream": "~1.0.0" 540 | } 541 | }, 542 | "core-js": { 543 | "version": "3.6.5", 544 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", 545 | "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" 546 | }, 547 | "define-properties": { 548 | "version": "1.1.3", 549 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 550 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", 551 | "requires": { 552 | "object-keys": "^1.0.12" 553 | } 554 | }, 555 | "delayed-stream": { 556 | "version": "1.0.0", 557 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 558 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 559 | }, 560 | "depd": { 561 | "version": "1.1.2", 562 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 563 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 564 | }, 565 | "deprecated-decorator": { 566 | "version": "0.1.6", 567 | "resolved": "https://registry.npmjs.org/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz", 568 | "integrity": "sha1-AJZjF7ehL+kvPMgx91g68ym4bDc=" 569 | }, 570 | "dicer": { 571 | "version": "0.3.0", 572 | "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz", 573 | "integrity": "sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA==", 574 | "requires": { 575 | "streamsearch": "0.1.2" 576 | } 577 | }, 578 | "es-abstract": { 579 | "version": "1.17.5", 580 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", 581 | "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", 582 | "requires": { 583 | "es-to-primitive": "^1.2.1", 584 | "function-bind": "^1.1.1", 585 | "has": "^1.0.3", 586 | "has-symbols": "^1.0.1", 587 | "is-callable": "^1.1.5", 588 | "is-regex": "^1.0.5", 589 | "object-inspect": "^1.7.0", 590 | "object-keys": "^1.1.1", 591 | "object.assign": "^4.1.0", 592 | "string.prototype.trimleft": "^2.1.1", 593 | "string.prototype.trimright": "^2.1.1" 594 | } 595 | }, 596 | "es-to-primitive": { 597 | "version": "1.2.1", 598 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", 599 | "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", 600 | "requires": { 601 | "is-callable": "^1.1.4", 602 | "is-date-object": "^1.0.1", 603 | "is-symbol": "^1.0.2" 604 | } 605 | }, 606 | "eventemitter3": { 607 | "version": "3.1.2", 608 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", 609 | "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==" 610 | }, 611 | "events": { 612 | "version": "1.1.1", 613 | "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", 614 | "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", 615 | "dev": true 616 | }, 617 | "fast-json-stable-stringify": { 618 | "version": "2.1.0", 619 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 620 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" 621 | }, 622 | "form-data": { 623 | "version": "3.0.0", 624 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", 625 | "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", 626 | "requires": { 627 | "asynckit": "^0.4.0", 628 | "combined-stream": "^1.0.8", 629 | "mime-types": "^2.1.12" 630 | } 631 | }, 632 | "fs-capacitor": { 633 | "version": "2.0.4", 634 | "resolved": "https://registry.npmjs.org/fs-capacitor/-/fs-capacitor-2.0.4.tgz", 635 | "integrity": "sha512-8S4f4WsCryNw2mJJchi46YgB6CR5Ze+4L1h8ewl9tEpL4SJ3ZO+c/bS4BWhB8bK+O3TMqhuZarTitd0S0eh2pA==" 636 | }, 637 | "function-bind": { 638 | "version": "1.1.1", 639 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 640 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 641 | }, 642 | "graphql": { 643 | "version": "15.0.0", 644 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.0.0.tgz", 645 | "integrity": "sha512-ZyVO1xIF9F+4cxfkdhOJINM+51B06Friuv4M66W7HzUOeFd+vNzUn4vtswYINPi6sysjf1M2Ri/rwZALqgwbaQ==" 646 | }, 647 | "graphql-extensions": { 648 | "version": "0.11.1", 649 | "resolved": "https://registry.npmjs.org/graphql-extensions/-/graphql-extensions-0.11.1.tgz", 650 | "integrity": "sha512-1bstq6YKaC579PTw9gchw2VlXqjPo3vn8NjRMaUqF2SxyYTjVSgXaCAbaeNa0B7xlLVigxi3DV1zh4A+ss+Lwg==", 651 | "requires": { 652 | "@apollographql/apollo-tools": "^0.4.3", 653 | "apollo-server-env": "^2.4.3", 654 | "apollo-server-types": "^0.3.1" 655 | } 656 | }, 657 | "graphql-tag": { 658 | "version": "2.10.3", 659 | "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.3.tgz", 660 | "integrity": "sha512-4FOv3ZKfA4WdOKJeHdz6B3F/vxBLSgmBcGeAFPf4n1F64ltJUvOOerNj0rsJxONQGdhUMynQIvd6LzB+1J5oKA==" 661 | }, 662 | "graphql-tools": { 663 | "version": "4.0.8", 664 | "resolved": "https://registry.npmjs.org/graphql-tools/-/graphql-tools-4.0.8.tgz", 665 | "integrity": "sha512-MW+ioleBrwhRjalKjYaLQbr+920pHBgy9vM/n47sswtns8+96sRn5M/G+J1eu7IMeKWiN/9p6tmwCHU7552VJg==", 666 | "requires": { 667 | "apollo-link": "^1.2.14", 668 | "apollo-utilities": "^1.0.1", 669 | "deprecated-decorator": "^0.1.6", 670 | "iterall": "^1.1.3", 671 | "uuid": "^3.1.0" 672 | } 673 | }, 674 | "graphql-upload": { 675 | "version": "8.1.0", 676 | "resolved": "https://registry.npmjs.org/graphql-upload/-/graphql-upload-8.1.0.tgz", 677 | "integrity": "sha512-U2OiDI5VxYmzRKw0Z2dmfk0zkqMRaecH9Smh1U277gVgVe9Qn+18xqf4skwr4YJszGIh7iQDZ57+5ygOK9sM/Q==", 678 | "requires": { 679 | "busboy": "^0.3.1", 680 | "fs-capacitor": "^2.0.4", 681 | "http-errors": "^1.7.3", 682 | "object-path": "^0.11.4" 683 | } 684 | }, 685 | "has": { 686 | "version": "1.0.3", 687 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 688 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 689 | "requires": { 690 | "function-bind": "^1.1.1" 691 | } 692 | }, 693 | "has-symbols": { 694 | "version": "1.0.1", 695 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", 696 | "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" 697 | }, 698 | "http-errors": { 699 | "version": "1.7.3", 700 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", 701 | "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", 702 | "requires": { 703 | "depd": "~1.1.2", 704 | "inherits": "2.0.4", 705 | "setprototypeof": "1.1.1", 706 | "statuses": ">= 1.5.0 < 2", 707 | "toidentifier": "1.0.0" 708 | } 709 | }, 710 | "ieee754": { 711 | "version": "1.1.13", 712 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", 713 | "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", 714 | "dev": true 715 | }, 716 | "inherits": { 717 | "version": "2.0.4", 718 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 719 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 720 | }, 721 | "is-callable": { 722 | "version": "1.1.5", 723 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", 724 | "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" 725 | }, 726 | "is-date-object": { 727 | "version": "1.0.2", 728 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", 729 | "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" 730 | }, 731 | "is-regex": { 732 | "version": "1.0.5", 733 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", 734 | "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", 735 | "requires": { 736 | "has": "^1.0.3" 737 | } 738 | }, 739 | "is-symbol": { 740 | "version": "1.0.3", 741 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", 742 | "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", 743 | "requires": { 744 | "has-symbols": "^1.0.1" 745 | } 746 | }, 747 | "isarray": { 748 | "version": "1.0.0", 749 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 750 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 751 | "dev": true 752 | }, 753 | "iterall": { 754 | "version": "1.3.0", 755 | "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.3.0.tgz", 756 | "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==" 757 | }, 758 | "jmespath": { 759 | "version": "0.15.0", 760 | "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", 761 | "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=", 762 | "dev": true 763 | }, 764 | "lodash.sortby": { 765 | "version": "4.7.0", 766 | "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", 767 | "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" 768 | }, 769 | "loglevel": { 770 | "version": "1.6.8", 771 | "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.8.tgz", 772 | "integrity": "sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==" 773 | }, 774 | "long": { 775 | "version": "4.0.0", 776 | "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", 777 | "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" 778 | }, 779 | "lru-cache": { 780 | "version": "5.1.1", 781 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", 782 | "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", 783 | "requires": { 784 | "yallist": "^3.0.2" 785 | } 786 | }, 787 | "mime-db": { 788 | "version": "1.43.0", 789 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", 790 | "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" 791 | }, 792 | "mime-types": { 793 | "version": "2.1.26", 794 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", 795 | "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", 796 | "requires": { 797 | "mime-db": "1.43.0" 798 | } 799 | }, 800 | "node-fetch": { 801 | "version": "2.6.0", 802 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", 803 | "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" 804 | }, 805 | "object-inspect": { 806 | "version": "1.7.0", 807 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", 808 | "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" 809 | }, 810 | "object-keys": { 811 | "version": "1.1.1", 812 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", 813 | "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" 814 | }, 815 | "object-path": { 816 | "version": "0.11.4", 817 | "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.4.tgz", 818 | "integrity": "sha1-NwrnUvvzfePqcKhhwju6iRVpGUk=" 819 | }, 820 | "object.assign": { 821 | "version": "4.1.0", 822 | "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", 823 | "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", 824 | "requires": { 825 | "define-properties": "^1.1.2", 826 | "function-bind": "^1.1.1", 827 | "has-symbols": "^1.0.0", 828 | "object-keys": "^1.0.11" 829 | } 830 | }, 831 | "object.getownpropertydescriptors": { 832 | "version": "2.1.0", 833 | "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", 834 | "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", 835 | "requires": { 836 | "define-properties": "^1.1.3", 837 | "es-abstract": "^1.17.0-next.1" 838 | } 839 | }, 840 | "punycode": { 841 | "version": "1.3.2", 842 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", 843 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", 844 | "dev": true 845 | }, 846 | "querystring": { 847 | "version": "0.2.0", 848 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 849 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", 850 | "dev": true 851 | }, 852 | "retry": { 853 | "version": "0.12.0", 854 | "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", 855 | "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" 856 | }, 857 | "safe-buffer": { 858 | "version": "5.2.0", 859 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", 860 | "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" 861 | }, 862 | "sax": { 863 | "version": "1.2.1", 864 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", 865 | "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=", 866 | "dev": true 867 | }, 868 | "setprototypeof": { 869 | "version": "1.1.1", 870 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 871 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 872 | }, 873 | "sha.js": { 874 | "version": "2.4.11", 875 | "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", 876 | "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", 877 | "requires": { 878 | "inherits": "^2.0.1", 879 | "safe-buffer": "^5.0.1" 880 | } 881 | }, 882 | "statuses": { 883 | "version": "1.5.0", 884 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 885 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 886 | }, 887 | "streamsearch": { 888 | "version": "0.1.2", 889 | "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", 890 | "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" 891 | }, 892 | "string.prototype.trimend": { 893 | "version": "1.0.1", 894 | "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", 895 | "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", 896 | "requires": { 897 | "define-properties": "^1.1.3", 898 | "es-abstract": "^1.17.5" 899 | } 900 | }, 901 | "string.prototype.trimleft": { 902 | "version": "2.1.2", 903 | "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", 904 | "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", 905 | "requires": { 906 | "define-properties": "^1.1.3", 907 | "es-abstract": "^1.17.5", 908 | "string.prototype.trimstart": "^1.0.0" 909 | } 910 | }, 911 | "string.prototype.trimright": { 912 | "version": "2.1.2", 913 | "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", 914 | "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", 915 | "requires": { 916 | "define-properties": "^1.1.3", 917 | "es-abstract": "^1.17.5", 918 | "string.prototype.trimend": "^1.0.0" 919 | } 920 | }, 921 | "string.prototype.trimstart": { 922 | "version": "1.0.1", 923 | "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", 924 | "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", 925 | "requires": { 926 | "define-properties": "^1.1.3", 927 | "es-abstract": "^1.17.5" 928 | } 929 | }, 930 | "subscriptions-transport-ws": { 931 | "version": "0.9.16", 932 | "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.16.tgz", 933 | "integrity": "sha512-pQdoU7nC+EpStXnCfh/+ho0zE0Z+ma+i7xvj7bkXKb1dvYHSZxgRPaU6spRP+Bjzow67c/rRDoix5RT0uU9omw==", 934 | "requires": { 935 | "backo2": "^1.0.2", 936 | "eventemitter3": "^3.1.0", 937 | "iterall": "^1.2.1", 938 | "symbol-observable": "^1.0.4", 939 | "ws": "^5.2.0" 940 | }, 941 | "dependencies": { 942 | "ws": { 943 | "version": "5.2.2", 944 | "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", 945 | "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", 946 | "requires": { 947 | "async-limiter": "~1.0.0" 948 | } 949 | } 950 | } 951 | }, 952 | "symbol-observable": { 953 | "version": "1.2.0", 954 | "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", 955 | "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" 956 | }, 957 | "toidentifier": { 958 | "version": "1.0.0", 959 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 960 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 961 | }, 962 | "ts-invariant": { 963 | "version": "0.4.4", 964 | "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", 965 | "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", 966 | "requires": { 967 | "tslib": "^1.9.3" 968 | } 969 | }, 970 | "tslib": { 971 | "version": "1.11.1", 972 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", 973 | "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" 974 | }, 975 | "url": { 976 | "version": "0.10.3", 977 | "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", 978 | "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", 979 | "dev": true, 980 | "requires": { 981 | "punycode": "1.3.2", 982 | "querystring": "0.2.0" 983 | } 984 | }, 985 | "util.promisify": { 986 | "version": "1.0.1", 987 | "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", 988 | "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", 989 | "requires": { 990 | "define-properties": "^1.1.3", 991 | "es-abstract": "^1.17.2", 992 | "has-symbols": "^1.0.1", 993 | "object.getownpropertydescriptors": "^2.1.0" 994 | } 995 | }, 996 | "uuid": { 997 | "version": "3.4.0", 998 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", 999 | "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" 1000 | }, 1001 | "ws": { 1002 | "version": "6.2.1", 1003 | "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", 1004 | "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", 1005 | "requires": { 1006 | "async-limiter": "~1.0.0" 1007 | } 1008 | }, 1009 | "xml2js": { 1010 | "version": "0.4.19", 1011 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", 1012 | "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", 1013 | "dev": true, 1014 | "requires": { 1015 | "sax": ">=0.6.0", 1016 | "xmlbuilder": "~9.0.1" 1017 | } 1018 | }, 1019 | "xmlbuilder": { 1020 | "version": "9.0.7", 1021 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", 1022 | "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", 1023 | "dev": true 1024 | }, 1025 | "yallist": { 1026 | "version": "3.1.1", 1027 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", 1028 | "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" 1029 | }, 1030 | "zen-observable": { 1031 | "version": "0.8.15", 1032 | "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", 1033 | "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" 1034 | }, 1035 | "zen-observable-ts": { 1036 | "version": "0.8.21", 1037 | "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz", 1038 | "integrity": "sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg==", 1039 | "requires": { 1040 | "tslib": "^1.9.3", 1041 | "zen-observable": "^0.8.0" 1042 | } 1043 | } 1044 | } 1045 | } 1046 | -------------------------------------------------------------------------------- /functions/remote-schema/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "remote-schema", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "apollo-server-lambda": "^2.12.0", 14 | "graphql": "^15.0.0" 15 | }, 16 | "devDependencies": { 17 | "aws-sdk": "^2.659.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /functions/remote-schema/queries/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const queries = fs.readdirSync('./functions/remote-schema/queries') 4 | .reduce((p, f) => { 5 | if (f === 'index.js') return p; 6 | p[f.replace('.js', '')] = require(`./${f}`).default; 7 | return p; 8 | }, 9 | {} 10 | ); 11 | 12 | exports.queries = queries; 13 | -------------------------------------------------------------------------------- /functions/remote-schema/queries/signIn.js: -------------------------------------------------------------------------------- 1 | const AWS = require('aws-sdk'); 2 | const apollo = require('apollo-server-lambda'); 3 | 4 | const cognitoIdentityServiceProvider = new AWS.CognitoIdentityServiceProvider(); 5 | 6 | const signIn = async (parent, args) => { 7 | const { email, password } = args; 8 | if (!email || !password) { 9 | throw new apollo.UserInputError('You must specify the email and password'); 10 | } 11 | 12 | return cognitoIdentityServiceProvider.initiateAuth({ 13 | AuthFlow: 'USER_PASSWORD_AUTH', 14 | AuthParameters: { 15 | USERNAME: email, 16 | PASSWORD: password, 17 | }, 18 | ClientId: process.env.COGNITO_CLIENT_ID, 19 | }).promise().then((result) => result.AuthenticationResult) 20 | .catch((error) => { 21 | throw new apollo.AuthenticationError(error.message) 22 | }); 23 | }; 24 | 25 | exports.default = signIn; 26 | -------------------------------------------------------------------------------- /functions/remote-schema/types/AuthResult.js: -------------------------------------------------------------------------------- 1 | exports.default = `type AuthResult { 2 | AccessToken: String 3 | ExpiresIn: Int 4 | TokenType: String 5 | RefreshToken: String 6 | IdToken: String 7 | }`; 8 | -------------------------------------------------------------------------------- /functions/remote-schema/types/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const types = fs.readdirSync('./functions/remote-schema/types') 4 | .reduce((p, f) => { 5 | if (f === 'index.js') return p; 6 | p += require(`./${f}`).default; 7 | return p; 8 | }, 9 | '' 10 | ); 11 | 12 | exports.types = types; 13 | -------------------------------------------------------------------------------- /functions/remote-schema/types/mutation.js: -------------------------------------------------------------------------------- 1 | exports.default = `type Mutation { 2 | signUp(email: String!, password: String!): String 3 | }`; 4 | -------------------------------------------------------------------------------- /functions/remote-schema/types/query.js: -------------------------------------------------------------------------------- 1 | exports.default = `type Query { 2 | signIn(email: String!, password: String!): AuthResult 3 | }`; 4 | -------------------------------------------------------------------------------- /migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReyRod/graphql-api/58f768147d5b4f5bf6997e507150d4c33a7b04e9/migrations/.gitkeep -------------------------------------------------------------------------------- /migrations/1588020261196_create_remote_schema_remote-schema/down.yaml: -------------------------------------------------------------------------------- 1 | - args: 2 | name: remote-schema 3 | type: remove_remote_schema 4 | -------------------------------------------------------------------------------- /migrations/1588020261196_create_remote_schema_remote-schema/up.yaml: -------------------------------------------------------------------------------- 1 | - args: 2 | definition: 3 | forward_client_headers: true 4 | headers: [] 5 | timeout_seconds: 60 6 | url_from_env: REMOTE_SCHEMA 7 | name: remote-schema 8 | type: add_remote_schema 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graphql_api", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "handler.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "clean": "rm -rf node_modules && cd functions/remote-schema && rm -rf node_modules", 9 | "build": "npm i && cd functions/remote-schema && npm i && cd ../../", 10 | "start": "npm run build && sls deploy" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "devDependencies": { 15 | "hasura-cli": "^1.1.1", 16 | "serverless": "^1.67.3", 17 | "serverless-dotenv-plugin": "^2.3.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /resources/cloudfront.yml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | ELBHTTPPort: 3 | Type: 'Number' 4 | Default: 80 5 | Resources: 6 | Distribution: 7 | Type: 'AWS::CloudFront::Distribution' 8 | Properties: 9 | DistributionConfig: 10 | Comment: '${self:service}-${self:provider.stage}' 11 | DefaultRootObject: '' 12 | Enabled: true 13 | IPV6Enabled: true 14 | HttpVersion: 'http2' 15 | Origins: 16 | - Id: 'ecs' 17 | DomainName: 18 | Fn::GetAtt: ['LoadBalancer', 'DNSName'] 19 | CustomOriginConfig: 20 | HTTPPort: 21 | Ref: 'ELBHTTPPort' 22 | OriginProtocolPolicy: 'http-only' 23 | OriginSSLProtocols: 24 | - 'TLSv1.2' 25 | DefaultCacheBehavior: 26 | AllowedMethods: 27 | - 'GET' 28 | - 'HEAD' 29 | - 'OPTIONS' 30 | - 'PUT' 31 | - 'PATCH' 32 | - 'POST' 33 | - 'DELETE' 34 | Compress: true 35 | ForwardedValues: 36 | QueryString: true 37 | TargetOriginId: 'ecs' 38 | ViewerProtocolPolicy: 'redirect-to-https' 39 | -------------------------------------------------------------------------------- /resources/cognito.yml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | RefreshTokenValidity: 3 | Type: 'Number' 4 | Default: 30 5 | Resources: 6 | UserPool: 7 | Type: 'AWS::Cognito::UserPool' 8 | Properties: 9 | UserPoolName: '${self:service}-${self:provider.stage}-user-pool' 10 | UsernameAttributes: 11 | - 'email' 12 | AutoVerifiedAttributes: 13 | - 'email' 14 | VerificationMessageTemplate: 15 | DefaultEmailOption: CONFIRM_WITH_LINK 16 | UserPoolClient: 17 | Type: 'AWS::Cognito::UserPoolClient' 18 | Properties: 19 | ClientName: '${self:service}-${self:provider.stage}-user-pool-client' 20 | UserPoolId: 21 | Ref: 'UserPool' 22 | ExplicitAuthFlows: 23 | - 'ALLOW_USER_PASSWORD_AUTH' 24 | - 'ALLOW_REFRESH_TOKEN_AUTH' 25 | PreventUserExistenceErrors: 'ENABLED' 26 | SupportedIdentityProviders: 27 | - 'COGNITO' 28 | UserPoolDomain: 29 | Type: 'AWS::Cognito::UserPoolDomain' 30 | Properties: 31 | UserPoolId: 32 | Ref: UserPool 33 | Domain: '${self:provider.stage}-domain' 34 | -------------------------------------------------------------------------------- /resources/ecs.yml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | ServiceDiscoveryTTL: 3 | Type: 'Number' 4 | Default: 60 5 | ServiceDiscoveryNamespaceName: 6 | Type: 'String' 7 | Default: '${self:service}-${self:provider.stage}' 8 | ContainerName: 9 | Type: 'String' 10 | Default: '${self:service}-${self:provider.stage}-container' 11 | ContainerPort: 12 | Type: 'Number' 13 | Default: 8080 14 | ContainerImage: 15 | Type: 'String' 16 | Default: 'registry.hub.docker.com/hasura/graphql-engine:v1.1.1' 17 | DesiredCount: 18 | Type: 'Number' 19 | Default: 1 20 | TaskCpu: 21 | Type: 'Number' 22 | Default: 512 23 | TaskMemory: 24 | Type: 'Number' 25 | Default: 1024 26 | AdminSecret: 27 | Type: 'String' 28 | Default: '${self:provider.environment.HASURA_ADMIN_SECRET}' 29 | EnableConsole: 30 | Type: 'String' 31 | Default: 'true' 32 | EnableTelemetry: 33 | Type: 'String' 34 | Default: 'false' 35 | UnauthorizedRole: 36 | Type: 'String' 37 | Default: 'anonymous' 38 | Resources: 39 | ExecutionRole: 40 | Type: 'AWS::IAM::Role' 41 | Properties: 42 | RoleName: 'ECSExecutionRole' 43 | AssumeRolePolicyDocument: 44 | Version: '2012-10-17' 45 | Statement: 46 | - Effect: 'Allow' 47 | Principal: 48 | Service: 49 | - 'ecs-tasks.amazonaws.com' 50 | Action: 51 | - 'sts:AssumeRole' 52 | ManagedPolicyArns: 53 | - 'arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy' 54 | LogGroup: 55 | Type: 'AWS::Logs::LogGroup' 56 | Properties: 57 | LogGroupName: '/ecs/${self:service}-${self:provider.stage}' 58 | Cluster: 59 | Type: 'AWS::ECS::Cluster' 60 | Properties: 61 | ClusterName: '${self:service}-${self:provider.stage}-cluster' 62 | TaskDefinition: 63 | Type: 'AWS::ECS::TaskDefinition' 64 | Properties: 65 | ExecutionRoleArn: 66 | Ref: 'ExecutionRole' 67 | RequiresCompatibilities: 68 | - 'FARGATE' 69 | NetworkMode: 'awsvpc' 70 | Family: '${self:service}-${self:provider.stage}-task-definition' 71 | Cpu: 72 | Ref: 'TaskCpu' 73 | Memory: 74 | Ref: 'TaskMemory' 75 | ContainerDefinitions: 76 | - Name: 77 | Ref: 'ContainerName' 78 | Image: 79 | Ref: 'ContainerImage' 80 | PortMappings: 81 | - ContainerPort: 82 | Ref: 'ContainerPort' 83 | Environment: 84 | - Name: 'HASURA_GRAPHQL_ADMIN_SECRET' 85 | Value: 86 | Ref: 'AdminSecret' 87 | - Name: 'HASURA_GRAPHQL_ENABLE_CONSOLE' 88 | Value: 89 | Ref: 'EnableConsole' 90 | - Name: 'HASURA_GRAPHQL_ENABLE_TELEMETRY' 91 | Value: 92 | Ref: 'EnableTelemetry' 93 | - Name: 'HASURA_GRAPHQL_UNAUTHORIZED_ROLE' 94 | Value: 95 | Ref: 'UnauthorizedRole' 96 | - Name: 'HASURA_GRAPHQL_DATABASE_URL' 97 | Value: 98 | Fn::Join: 99 | - '' 100 | - - 'postgres://' 101 | - '${self:provider.environment.DATABASE_USERNAME}' 102 | - ':' 103 | - '${self:provider.environment.DATABASE_PASSWORD}' 104 | - '@' 105 | - Fn::GetAtt: ['DB', 'Endpoint.Address'] 106 | - '/' 107 | - Ref: 'DBName' 108 | - Name: 'HASURA_GRAPHQL_JWT_SECRET' 109 | Value: 110 | Fn::Join: 111 | - '' 112 | - - '{"type":"RS256","jwk_url":"https://cognito-idp.' 113 | - '${self:provider.region}' 114 | - '.amazonaws.com/' 115 | - Ref: 'UserPool' 116 | - '/.well-known/jwks.json","claims_format":"stringified_json"}' 117 | - Name: 'REMOTE_SCHEMA' 118 | Value: { "Fn::Join" : ["", ["https://", { "Ref" : "ApiGatewayRestApi" }, ".execute-api.${self:provider.region}.amazonaws.com/${self:provider.stage}", "/remote-schema" ] ] } 119 | - Name: 'EVENT_TRIGGER' 120 | Value: { "Fn::Join" : ["", ["https://", { "Ref" : "ApiGatewayRestApi" }, ".execute-api.${self:provider.region}.amazonaws.com/${self:provider.stage}", "/event-triggers" ] ] } 121 | LogConfiguration: 122 | LogDriver: 'awslogs' 123 | Options: 124 | 'awslogs-group': 125 | Ref: 'LogGroup' 126 | 'awslogs-region': '${self:provider.region}' 127 | 'awslogs-stream-prefix': 'ecs' 128 | ServiceDiscoveryNamespace: 129 | Type: 'AWS::ServiceDiscovery::PrivateDnsNamespace' 130 | Properties: 131 | Name: '${self:service}-${self:provider.stage}' 132 | Vpc: 133 | Ref: 'VPC' 134 | ServiceDiscovery: 135 | Type: 'AWS::ServiceDiscovery::Service' 136 | Properties: 137 | NamespaceId: 138 | Ref: 'ServiceDiscoveryNamespace' 139 | Name: 'service' 140 | DnsConfig: 141 | DnsRecords: 142 | - Type: 'A' 143 | TTL: 144 | Ref: 'ServiceDiscoveryTTL' 145 | Service: 146 | Type: 'AWS::ECS::Service' 147 | DependsOn: 'Listener' 148 | Properties: 149 | ServiceName: '${self:service}-${self:provider.stage}-service' 150 | LaunchType: 'FARGATE' 151 | DesiredCount: 152 | Ref: 'DesiredCount' 153 | Cluster: 154 | Ref: 'Cluster' 155 | TaskDefinition: 156 | Ref: 'TaskDefinition' 157 | HealthCheckGracePeriodSeconds: 3600 158 | NetworkConfiguration: 159 | AwsvpcConfiguration: 160 | AssignPublicIp: 'ENABLED' 161 | SecurityGroups: 162 | - Fn::GetAtt: ['VPC', 'DefaultSecurityGroup'] 163 | - Ref: 'HTTPSecurityGroup' 164 | Subnets: 165 | - Ref: 'PublicSubnet1' 166 | - Ref: 'PublicSubnet2' 167 | LoadBalancers: 168 | - TargetGroupArn: 169 | Ref: 'TargetGroup' 170 | ContainerName: 171 | Ref: 'ContainerName' 172 | ContainerPort: 173 | Ref: 'ContainerPort' 174 | ServiceRegistries: 175 | - RegistryArn: 176 | Fn::GetAtt: ['ServiceDiscovery', 'Arn'] 177 | ContainerName: 178 | Ref: 'ContainerName' 179 | -------------------------------------------------------------------------------- /resources/elb.yml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | HTTPPort: 3 | Type: 'Number' 4 | Default: 80 5 | InternalHTTPPort: 6 | Type: 'Number' 7 | Default: 8080 8 | Resources: 9 | HTTPSecurityGroup: 10 | Type: 'AWS::EC2::SecurityGroup' 11 | Properties: 12 | GroupDescription: '${self:service}-${self:provider.stage}-http-security-group' 13 | VpcId: 14 | Ref: 'VPC' 15 | SecurityGroupIngress: 16 | - IpProtocol: 'tcp' 17 | FromPort: 18 | Ref: 'HTTPPort' 19 | ToPort: 20 | Ref: 'HTTPPort' 21 | CidrIp: '0.0.0.0/0' 22 | - IpProtocol: 'tcp' 23 | FromPort: 24 | Ref: 'InternalHTTPPort' 25 | ToPort: 26 | Ref: 'InternalHTTPPort' 27 | CidrIp: '0.0.0.0/0' 28 | LoadBalancer: 29 | Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer' 30 | Properties: 31 | Name: '${self:service}-${self:provider.stage}-load-balancer' 32 | Subnets: 33 | - Ref: 'PublicSubnet1' 34 | - Ref: 'PublicSubnet2' 35 | SecurityGroups: 36 | - Ref: 'HTTPSecurityGroup' 37 | TargetGroup: 38 | Type: 'AWS::ElasticLoadBalancingV2::TargetGroup' 39 | Properties: 40 | Name: '${self:service}-${self:provider.stage}-target-group' 41 | HealthCheckEnabled: true 42 | HealthCheckPath: '/healthz' 43 | Port: 44 | Ref: 'ContainerPort' 45 | Protocol: 'HTTP' 46 | TargetType: 'ip' 47 | VpcId: 48 | Ref: 'VPC' 49 | Listener: 50 | Type: 'AWS::ElasticLoadBalancingV2::Listener' 51 | Properties: 52 | Port: 53 | Ref: 'HTTPPort' 54 | Protocol: 'HTTP' 55 | LoadBalancerArn: 56 | Ref: 'LoadBalancer' 57 | DefaultActions: 58 | - Type: 'forward' 59 | TargetGroupArn: 60 | Ref: 'TargetGroup' 61 | -------------------------------------------------------------------------------- /resources/rds.yml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | DBUsername: 3 | Type: 'String' 4 | Default: '${self:provider.environment.DATABASE_USERNAME}' 5 | DBPassword: 6 | Type: 'String' 7 | Default: '${self:provider.environment.DATABASE_PASSWORD}' 8 | EngineVersion: 9 | Type: 'String' 10 | Default: '10.7' 11 | DBPort: 12 | Type: 'Number' 13 | Default: 5432 14 | DBName: 15 | Type: 'String' 16 | Default: '${self:service}' 17 | Resources: 18 | DBSecurityGroup: 19 | Type: 'AWS::EC2::SecurityGroup' 20 | Properties: 21 | GroupDescription: '${self:service}-${self:provider.stage}-db-security-group' 22 | VpcId: 23 | Ref: 'VPC' 24 | SecurityGroupIngress: 25 | - IpProtocol: 'tcp' 26 | FromPort: 27 | Ref: 'DBPort' 28 | ToPort: 29 | Ref: 'DBPort' 30 | SourceSecurityGroupId: 31 | Fn::GetAtt: ['VPC', 'DefaultSecurityGroup'] 32 | SubnetGroup: 33 | Type: 'AWS::RDS::DBSubnetGroup' 34 | Properties: 35 | DBSubnetGroupDescription: 'Private' 36 | SubnetIds: 37 | - Ref: 'PrivateSubnet1' 38 | - Ref: 'PrivateSubnet2' 39 | DB: 40 | Type: 'AWS::RDS::DBCluster' 41 | Properties: 42 | DBClusterIdentifier: '${self:service}-${self:provider.stage}-db' 43 | DatabaseName: 44 | Ref: 'DBName' 45 | DBSubnetGroupName: 46 | Ref: 'SubnetGroup' 47 | Engine: 'aurora-postgresql' 48 | EngineMode: 'serverless' 49 | EngineVersion: 50 | Ref: 'EngineVersion' 51 | MasterUsername: 52 | Ref: 'DBUsername' 53 | MasterUserPassword: 54 | Ref: 'DBPassword' 55 | Port: 56 | Ref: 'DBPort' 57 | VpcSecurityGroupIds: 58 | - Ref: 'DBSecurityGroup' 59 | -------------------------------------------------------------------------------- /resources/vpc.yml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | VPCCidrBlock: 3 | Type: 'String' 4 | Default: '10.192.0.0/16' 5 | PublicSubnet1CidrBlock: 6 | Type: 'String' 7 | Default: '10.192.10.0/24' 8 | PublicSubnet2CidrBlock: 9 | Type: 'String' 10 | Default: '10.192.11.0/24' 11 | PrivateSubnet1CidrBlock: 12 | Type: 'String' 13 | Default: '10.192.20.0/24' 14 | PrivateSubnet2CidrBlock: 15 | Type: 'String' 16 | Default: '10.192.21.0/24' 17 | Resources: 18 | VPC: 19 | Type: 'AWS::EC2::VPC' 20 | Properties: 21 | CidrBlock: 22 | Ref: 'VPCCidrBlock' 23 | EnableDnsSupport: true 24 | EnableDnsHostnames: true 25 | InternetGateway: 26 | Type: 'AWS::EC2::InternetGateway' 27 | InternetGatewayAttachment: 28 | Type: 'AWS::EC2::VPCGatewayAttachment' 29 | Properties: 30 | InternetGatewayId: 31 | Ref: 'InternetGateway' 32 | VpcId: 33 | Ref: 'VPC' 34 | PublicSubnet1: 35 | Type: 'AWS::EC2::Subnet' 36 | Properties: 37 | VpcId: 38 | Ref: 'VPC' 39 | AvailabilityZone: 40 | Fn::Select: 41 | - 0 42 | - Fn::GetAZs: "" 43 | CidrBlock: 44 | Ref: 'PublicSubnet1CidrBlock' 45 | MapPublicIpOnLaunch: true 46 | PublicSubnet2: 47 | Type: 'AWS::EC2::Subnet' 48 | Properties: 49 | VpcId: 50 | Ref: 'VPC' 51 | AvailabilityZone: 52 | Fn::Select: 53 | - 1 54 | - Fn::GetAZs: "" 55 | CidrBlock: 56 | Ref: 'PublicSubnet2CidrBlock' 57 | MapPublicIpOnLaunch: true 58 | PrivateSubnet1: 59 | Type: 'AWS::EC2::Subnet' 60 | Properties: 61 | VpcId: 62 | Ref: 'VPC' 63 | AvailabilityZone: 64 | Fn::Select: 65 | - 0 66 | - Fn::GetAZs: "" 67 | CidrBlock: 68 | Ref: 'PrivateSubnet1CidrBlock' 69 | MapPublicIpOnLaunch: false 70 | PrivateSubnet2: 71 | Type: 'AWS::EC2::Subnet' 72 | Properties: 73 | VpcId: 74 | Ref: 'VPC' 75 | AvailabilityZone: 76 | Fn::Select: 77 | - 1 78 | - Fn::GetAZs: "" 79 | CidrBlock: 80 | Ref: 'PrivateSubnet2CidrBlock' 81 | MapPublicIpOnLaunch: false 82 | NatGateway1EIP: 83 | Type: 'AWS::EC2::EIP' 84 | DependsOn: 'InternetGatewayAttachment' 85 | Properties: 86 | Domain: 'vpc' 87 | NatGateway2EIP: 88 | Type: 'AWS::EC2::EIP' 89 | DependsOn: 'InternetGatewayAttachment' 90 | Properties: 91 | Domain: 'vpc' 92 | NatGateway1: 93 | Type: 'AWS::EC2::NatGateway' 94 | Properties: 95 | AllocationId: 96 | Fn::GetAtt: ['NatGateway1EIP', 'AllocationId'] 97 | SubnetId: 98 | Ref: 'PublicSubnet1' 99 | NatGateway2: 100 | Type: 'AWS::EC2::NatGateway' 101 | Properties: 102 | AllocationId: 103 | Fn::GetAtt: ['NatGateway2EIP', 'AllocationId'] 104 | SubnetId: 105 | Ref: 'PublicSubnet2' 106 | PublicRouteTable: 107 | Type: 'AWS::EC2::RouteTable' 108 | Properties: 109 | VpcId: 110 | Ref: 'VPC' 111 | DefaultPublicRoute: 112 | Type: 'AWS::EC2::Route' 113 | DependsOn: ['InternetGatewayAttachment'] 114 | Properties: 115 | RouteTableId: 116 | Ref: 'PublicRouteTable' 117 | DestinationCidrBlock: '0.0.0.0/0' 118 | GatewayId: 119 | Ref: 'InternetGateway' 120 | PublicSubnet1RouteTableAssociation: 121 | Type: 'AWS::EC2::SubnetRouteTableAssociation' 122 | Properties: 123 | RouteTableId: 124 | Ref: 'PublicRouteTable' 125 | SubnetId: 126 | Ref: 'PublicSubnet1' 127 | PublicSubnet2RouteTableAssociation: 128 | Type: 'AWS::EC2::SubnetRouteTableAssociation' 129 | Properties: 130 | RouteTableId: 131 | Ref: 'PublicRouteTable' 132 | SubnetId: 133 | Ref: 'PublicSubnet2' 134 | PrivateRouteTable1: 135 | Type: 'AWS::EC2::RouteTable' 136 | Properties: 137 | VpcId: 138 | Ref: 'VPC' 139 | DefaultPrivateRoute1: 140 | Type: 'AWS::EC2::Route' 141 | Properties: 142 | RouteTableId: 143 | Ref: 'PrivateRouteTable1' 144 | DestinationCidrBlock: '0.0.0.0/0' 145 | NatGatewayId: 146 | Ref: 'NatGateway1' 147 | PrivateSubnet1RouteTableAssociation: 148 | Type: 'AWS::EC2::SubnetRouteTableAssociation' 149 | Properties: 150 | RouteTableId: 151 | Ref: 'PrivateRouteTable1' 152 | SubnetId: 153 | Ref: 'PrivateSubnet1' 154 | PrivateRouteTable2: 155 | Type: 'AWS::EC2::RouteTable' 156 | Properties: 157 | VpcId: 158 | Ref: 'VPC' 159 | DefaultPrivateRoute2: 160 | Type: 'AWS::EC2::Route' 161 | Properties: 162 | RouteTableId: 163 | Ref: 'PrivateRouteTable2' 164 | DestinationCidrBlock: '0.0.0.0/0' 165 | NatGatewayId: 166 | Ref: 'NatGateway2' 167 | PrivateSubnet2RouteTableAssociation: 168 | Type: 'AWS::EC2::SubnetRouteTableAssociation' 169 | Properties: 170 | RouteTableId: 171 | Ref: 'PrivateRouteTable2' 172 | SubnetId: 173 | Ref: 'PrivateSubnet2' -------------------------------------------------------------------------------- /serverless.yml: -------------------------------------------------------------------------------- 1 | service: graphqlApi 2 | plugins: 3 | - serverless-dotenv-plugin 4 | 5 | provider: 6 | name: aws 7 | runtime: nodejs12.x 8 | stage: ${opt:stage, 'dev'} 9 | region: ${opt:region, 'us-east-1'} 10 | # versionFunctions: true 11 | vpc: 12 | securityGroupIds: 13 | - Fn::GetAtt: 14 | - 'VPC' 15 | - 'DefaultSecurityGroup' 16 | subnetIds: 17 | - Ref: 'PrivateSubnet1' 18 | - Ref: 'PrivateSubnet2' 19 | environment: 20 | HASURA_ADMIN_SECRET: ${env:HASURA_ADMIN_SECRET} 21 | DATABASE_USERNAME: ${env:DATABASE_USERNAME} 22 | DATABASE_PASSWORD: ${env:DATABASE_PASSWORD} 23 | COGNITO_CLIENT_ID: 24 | Ref: UserPoolClient 25 | 26 | package: 27 | individually: true 28 | exclude: 29 | - '*' 30 | - '**/*' 31 | 32 | functions: 33 | remote-schema: 34 | handler: functions/remote-schema/index.handler 35 | package: 36 | include: 37 | - functions/remote-schema/** 38 | events: 39 | - http: 40 | path: remote-schema 41 | method: post 42 | cors: true 43 | - http: 44 | path: remote-schema 45 | method: get 46 | cors: true 47 | event-triggers: 48 | handler: functions/event-triggers/index.handler 49 | package: 50 | include: 51 | - functions/event-triggers/** 52 | events: 53 | - http: 54 | path: event-triggers 55 | method: post 56 | cors: true 57 | pre-token-generation: 58 | handler: functions/cognito-triggers/pre-token-generation.handler 59 | package: 60 | include: 61 | - functions/cognito-triggers/pre-token-generation.js 62 | 63 | resources: 64 | - ${file(resources/cognito.yml)} 65 | - ${file(resources/vpc.yml)} 66 | - ${file(resources/elb.yml)} 67 | - ${file(resources/rds.yml)} 68 | - ${file(resources/ecs.yml)} 69 | - ${file(resources/cloudfront.yml)} 70 | --------------------------------------------------------------------------------