-
Notifications
You must be signed in to change notification settings - Fork 99
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
Colocate Graphql Apollo Server in this repository #113
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/quiet/quiet/lymkeiokz |
Serverless functions are well deployed and graphql endpoint is available there: https://quiet-git-prisma2-now.quiet.now.sh/graphql Build logs show that TS 3.7 is used
But still 2 issues.
Error: Can't find schema.prisma
2020-01-22T11:53:46.633Z undefined ERROR /var/task/api/src/schema/Object.js:94
where: { authUserId: user?.auth0Id },
^
SyntaxError: Unexpected token '.'
at Module._compile (internal/modules/cjs/loader.js:892:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/zeit/56c87e93/api/src/schema/index.ts:4:1)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)END RequestId: 7338ebe9-3766-44aa-b098-e569e55967de
Duration: 702.61 ms Billed Duration: 800 ms Memory Size: 3008 MB Max Memory Used: 70 MB
RequestId: 7338ebe9-3766-44aa-b098-e569e55967de Error: Runtime exited with error: exit status 1
Runtime.ExitError |
I temporary removed TS 3.7 syntax to perform some experimentations. Prisma2 version Different queries complexity on different envs Simple query{
items (where: {isDeleted: {equals: true}}) {
id
}
} Complex queryquery getSections($authUserId: String!) {
sections(
where: {
isDeleted: { equals: false }
owner: { authUserId: { equals: $authUserId } }
}
) {
id
createdAt
isExpanded
title: name
collections(
where: { isDeleted: { equals: false } }
orderBy: { createdAt: asc }
) {
id
slug
isDeleted
title: name
items(first: 4) {
id
title
author
}
}
}
} Executed on playground graphql both against heroku standalone deployment & serverless lambda environment. Here's the results
Now Functions is deployed on the default region that seems to be UDPATE: Got much better performance results by deploying Now Functions on
Probably due to n+1 problem, where many roundtrips are much more impacted by db latency. |
This is an attempt to deploy an Apollo Server using Prisma2 to Now.
Let's monitor it to see how much does the cold start impact performance.