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

Brianna/step three #18

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft

Conversation

BCerki
Copy link

@BCerki BCerki commented Feb 28, 2022

Notes to self:

To start Postgraphile, run npx postgraphile -c todo_app -s todo_app --watch --enhance-graphiql --cors --classic-ids

  • --cors fixes the cors errors
  • --classic-ids fixes "Uncaught Invariant Violation: RelayResponseNormalizer: Expected id of elements of field nodes to be strings."

To make schema.graphql, run postgraphile -X -c postgres://localhost/your_db -s your_schema --export-schema-graphql schema/schema.graphql --export-schema-json schema/schema.json --classic-ids --sort-export

In addition to the Relay docs, see https://create-react-app.dev/docs/adding-relay/

@BCerki BCerki force-pushed the brianna/step-three branch from d4149a8 to 8f38d66 Compare March 1, 2022 16:58
Comment on lines 15 to 25
query AppQuery {
allTodos {
nodes {
id,
task,
completed,
dateCreated,
dateUpdated
}
}
}
Copy link
Author

Choose a reason for hiding this comment

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

At first I tried copy/pasting the query I made in graphiql, but I got errors and ended up tweaking to this. Should copy/pasted graphiql queries work, or is it normal to use a slightly different format for Relay?

Choose a reason for hiding this comment

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

Other than Relay having requirements when it comes to query/mutation/fragment naming conventions, they should work the same. What errors did you have?

Copy link
Author

Choose a reason for hiding this comment

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

I must have tried it before troubleshooting babel because it's working now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants