serverless-graphql | Serverless GraphQL Examples for AWS AppSync and Apollo | GraphQL library
kandi X-RAY | serverless-graphql Summary
kandi X-RAY | serverless-graphql Summary
Part 1: Running a scalable & reliable GraphQL endpoint with Serverless Part 2: AppSync Backend: AWS Managed GraphQL Service Part 3: AppSync Frontend: AWS Managed GraphQL Service.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of serverless-graphql
serverless-graphql Key Features
serverless-graphql Examples and Code Snippets
Community Discussions
Trending Discussions on serverless-graphql
QUESTION
I am introducing my self to serverless and stumbled upon this: https://github.com/serverless-components/express and can't seem to understand what's difference with serverfull deployed to heroku? see i have this code in serverless:
...ANSWER
Answered 2021-Jan-21 at 19:22Some of the benefits of serverless: you execute your code on-demand only when it's needed in contrast to the traditional servers that will be running 24/7. In addition, it also managed by a service provider so you won't need to worry about maintaining and scaling your server.
You can read more
https://www.serverless.com/blog/running-scalable-reliable-graphql-endpoint-with-serverless
https://aws.amazon.com/serverless/
https://serverless.com/blog/serverless-architecture-code-patterns/
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install serverless-graphql
Please note: AWS CLI is required to be installed on your system. Also, please make sure GraphQL endpoint is configured correctly in config/security.env.local to run client on local.
Select Backend
AWS Appsync (Serverless Offline does not support Appsync at this point) AWS DynamoDB AWS ElasticSearch AWS Lambda
Lambda Backend (Serverless Offline Supported) Twitter Rest API cd app-backend/rest-api yarn start Generate your Consumer Key and Secret Key for a Twitter App and update config DynamoDB cd app-backend/dynamodb yarn start RDS cd app-backend/rds yarn start
Start FrontEnd (Apollo Client or Appsync Client)
For Appsync Backend please select Appsync Client Integration: cd app-client/appsync-client/ yarn start
For Lambda Backend please select Apollo Client Integration: cd app-client/apollo-client/ yarn start
Start GraphiQL
Start GraphQL Playground (GraphiQL replacement - coming soon)
Sample Query for GraphiQL, Playground or GraphQL
Configure your AWS keys. Here you can find a 2min walkthrough how to do retrieve the keys. You need to make sure you have access to your deployed lambda functions. Note Please make sure latest serverless package is installed npm install -g serverless@latest. To use aws appsync you will need to create cognito user pool to authenticate the API Reference.
Select Backend
AWS Appsync (Supported by Serverless-AppSync-Plugin)
Lambda Backend (Serverless Offline Supported) Twitter Rest API cd app-backend/rest-api yarn deploy-prod DynamoDB cd app-backend/dynamodb yarn deploy-prod RDS Create RDS Instance. For example - PostGres Tutorial Please make sure connectivity to production RDS instance works (For example: test via razersql) Edit the config/security.env.prod file and replace the DATABASE_URL variable with your amazon rds endpoint (eg: postgres://${username}:{password}@${endpoint):5432/${dbName}). Run the deployment command cd app-backend/rds yarn deploy-prod
Config: Get your /graphql POST endpoint as shown below and use it in config/security.env.prod NOTE Please remove all quotes and <> and place only your POST endpoint url otherwise you will get 405 method not allowed error on POST to your endpoint
Select Frontend (apollo-client or appsync-client)
Note: For lambda please use apollo-client For appsync backend please use appsync-client Please note that backend is deployed before deploying frontend. You can deploy the client on AWS S3 or Netlify.
AWS S3 First you will need to choose custom s3 bucket name for client. For ex: s3-firstname-serverless-graphql. Please note that bucket name must be unique across all aws buckets. Now, in app-client/<client-name>/serverless.yml edit the custom.client.bucketName property and replace it the bucket name above. Now, in app-client/<client-name>/package.json edit the homepage property with https://${yourBucketName}.s3-website-us-east-1.amazonaws.com. For ex: https://s3-bucketname-serverless-graphql.s3-website-us-east-1.amazonaws.com Run the deployment command cd app-client/<client-name>/ yarn deploy-s3 # Your deployment url will be printed on the console Your deployment url will be : https://s3.amazonaws.com/[bucket-name]/index.html
Netlify First you will need to create a new account. Please see https://www.netlify.com/docs/cli/ for details. Remove homepage property in app-client/<client-name>/package.json. This property is not required while deploying to netlify but is required for aws s3 deployment. The first time you use the cli tool, you’ll be asked to authenticate through the browser. After you authenticate netlify will store an access token in a global ~/.netlify/config Run deployment command cd app-client/<client-name>/ yarn deploy-netlify ? No site id specified, create a new site (Y/n) Y ? Path to deploy? (current dir) build Your deployment url will be printed on the console
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page