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

Add with-edgedb example #35929

Merged
merged 9 commits into from Apr 27, 2022
Merged

Add with-edgedb example #35929

merged 9 commits into from Apr 27, 2022

Conversation

colinhacks
Copy link
Contributor

Documentation / Examples

  • Make sure the linting passes by running yarn lint

@ijjk ijjk added the examples Issue/PR related to examples label Apr 6, 2022
examples/with-edgedb/.gitignore Outdated Show resolved Hide resolved
examples/with-edgedb/components/Post.tsx Outdated Show resolved Hide resolved
examples/with-edgedb/package.json Outdated Show resolved Hide resolved
examples/with-edgedb/package.json Outdated Show resolved Hide resolved
examples/with-edgedb/pages/blog/[id].tsx Outdated Show resolved Hide resolved
@colinhacks colinhacks requested a review from leerob April 8, 2022 20:32
@ijjk ijjk added create-next-app Related to our CLI tool for quickly starting a new Next.js application. area: documentation type: next labels Apr 14, 2022
@colinhacks
Copy link
Contributor Author

@ijjk Just addressed the reviews 👍

@steven-tey
Copy link
Contributor

Hey I'm just reviewing this example – while everything works fine in localhost, I'm having issues deploying it to prod.

I'm going with the DigitalOcean example and I'm stuck on the One-Click Deploy step:

CleanShot 2022-04-16 at 13 05 56

As a result, I'm not able to get the EDGEDB_DSN connection string – do I get it from the CLI? From Digital Ocean?

When I deploy it to Vercel, there's also an issue where I can't generate edgeql-js in prod since we added it to .gitignore

CleanShot 2022-04-16 at 13 06 40

I tried adding predev and prebuild in package.json:

"scripts": {
    "predev": "npx edgeql-js",
    "dev": "next",
    "prebuild": "npx edgeql-js",
    "build": "next build",
    "start": "next start",
    "seed": "ts-node dbschema/seed.ts"
  },

But it still doesn't work.

@1st1
Copy link

1st1 commented Apr 16, 2022

One of the other errors Steve had with his app, not sure if this is related to this repo or not

image

image

Regarding the second screenshot -- it appears the problem was that the DB (and the schema) were empty. Maybe we add a script to check that condition and error out with a clearer build-time error suggesting that the DB is empty?

Checking if a db is empty or not is relatively easy:

        SELECT
            count(
                schema::Module
                FILTER NOT .builtin AND NOT .name = "default"
            ) + count(
                schema::Object
                FILTER .name LIKE "default::%"
            )

should return 0

@colinhacks
Copy link
Contributor Author

colinhacks commented Apr 18, 2022

@steven-tey I updated this with all the fixes we found yesterday, addressed the issues Yury mentioned, and added more detailed deployment instructions as well.

@colinhacks colinhacks requested a review from ijjk April 18, 2022 16:13
Copy link
Member

@leerob leerob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

@kodiakhq kodiakhq bot merged commit 842e4ec into vercel:canary Apr 27, 2022
@1st1
Copy link

1st1 commented Apr 27, 2022

Thanks @leerob @steven-tey and @ijjk! 🎉

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application. examples Issue/PR related to examples type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants