Closed joshxfi closed 4 months ago
Latest commit: 3860e35fedf3a14f93130fe53b6cab2b8cd84bc4
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Hi! Thank you for taking the time to contribute here 🙂
This is not an unintended semicolon, removing it actually breaks the code. This is because of JS auto-semicolon feature. We are not manually putting semicolon at the end of our lines here, so JS adds them for us. But sometimes, it doesn't understand where the end of the statement is. It is the case here: if you remove the semicolon, the function returned by createYoga
will be executed with the following anonymous function as a parameter.
But I agree this is not very readable. But I would suggest to either not have an IIF, or add all semicolons, which would resolve the ambiguity.
I see, I noticed that no semicolons are used as a convention so I thought it was unintended. But yes, you're correct, not including the semicolon may cause an error with the IIFE. I'll close this pr, thanks for your time!
https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-nextjs#example-1