maxdarque / up-graphql-yoga-server-example Goto Github PK
View Code? Open in Web Editor NEWTutorial on how deploy your graphql-yoga server on AWS Lambda with Apex Up
Tutorial on how deploy your graphql-yoga server on AWS Lambda with Apex Up
I can connect fine from the playground but getting CORS errors when calling from apollo client in a web page. I have:
Enabled CORS in AWS Gateway (and deployed)
my up.json is as follows (and my app is running on localhost port 3000):
"cors": {
"allowed_origins": ["http://localhost:3000"],
"allowed_methods": ["HEAD", "GET", "POST"],
"allowed_headers": ["*"]
}
followed the boilerplate for setting up apollo client: https://github.com/graphql-boilerplates/vue-fullstack-graphql/blob/master/advanced/src/main.js
This is what I get:
Failed to load https://10t6y41fnc.execute-api.us-east-1.amazonaws.com/development: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 500. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
What am I missing?
I followed the tutorial and get { "message": "Forbidden" }
when playground opens at "my-aws-api-url.com/staging/".
I also tried to change the url to "my-aws-api-url.com/development/" but then I only get a white page with the same message. I used the IAM Policy recommended in the Apex Up manual - but I guess since everything deploys fine - it's irrelevant.
This is the deployment: https://r9tiudkyrf.execute-api.eu-west-1.amazonaws.com/staging/
I checked that my endpoint actually works by querying it (using token in playground).
Here it is: https://eu1.prisma.sh/geirbo/up-graphql-yoga-server-example/dev
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.