Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sample request and timeout #1

Merged
merged 2 commits into from
Mar 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const resolvers = {
},
Mutation: {
uploadFiles: async (parent, { files }) => {
console.log('files', files);
const { createReadStream, filename, mimetype, encoding } = await files[0];
console.log(filename);
console.log(createReadStream());
Expand All @@ -44,7 +45,7 @@ const server = new ApolloServer({
resolvers,
formatError: error => {
console.log(error);
return new Error("Internal server error");
return new Error(error.message);
}
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "apollo-server-lambda-demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "graphql.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "cd apollo-server-lambda && tsc",
Expand Down
2 changes: 1 addition & 1 deletion postman.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{
"key": "1",
"type": "file",
"src": ""
"src": "package.json"
}
]
},
Expand Down
1 change: 1 addition & 0 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Resources:
Properties:
Handler: graphql.handler
Runtime: nodejs8.10
Timeout: 10
Events:
AnyRequest:
Type: Api
Expand Down
Loading