-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: main
Are you sure you want to change the base?
Conversation
d4149a8
to
8f38d66
Compare
client/src/App.tsx
Outdated
query AppQuery { | ||
allTodos { | ||
nodes { | ||
id, | ||
task, | ||
completed, | ||
dateCreated, | ||
dateUpdated | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
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 fieldnodes
to be strings."To make
schema.graphql
, runpostgraphile -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/