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

Part 3 #17

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

Part 3 #17

wants to merge 9 commits into from

Conversation

andrea-williams
Copy link

No description provided.

Copy link

@Sepehr-Sobhani Sepehr-Sobhani left a comment

Choose a reason for hiding this comment

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

Beautiful 🤩 !! Just a few comments on how to make things better, but don't worry about fixing them.

Comment on lines +62 to +82
- command used: `npx postgraphile -c postgresql://awilliam@localhost:5432/todo --schema todo_app --watch`
3. Open the Graphiql (a graphical UI for GraphQL queries) instance that should be live at `/graphiql` on localhost once Postgraphile is running.
4. Confirm that GraphQL is introspecting your Postgres schema by querying the todos you inserted in the previous step.
- query used in /graphiql:
```
{
query {
allTodos {
edges {
node {
id
task
completed
dateCreated
dateUpdated
}
}
}
}
}
```

Choose a reason for hiding this comment

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

Thanks for updating This 🤩 Since we don't merge onboarding PRs, maybe you want to make a separate PR for this.

"**/node_modules/**",
"**/__mocks__/**",
"**/__generated__/**"
]

Choose a reason for hiding this comment

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

You can make sure all your relay compiled queries end up in the same folder by adding this:

module.exports = {
  ...
  artifactDirectory: "./__generated__",
  ...
}

variables,
}),
});

Choose a reason for hiding this comment

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

We could use an error handler here if json has errors.

Choose a reason for hiding this comment

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

the team uses lowercase SQL as a coding standard. we also use the snake case naming convention for SQL files.

Comment on lines +6 to +17
INSERT INTO todo_app.todos (task, completed, date_updated)
VALUES ('Part 1', True, null);
INSERT INTO todo_app.todos (task, completed, date_updated)
VALUES ('Part 2', False, null);
INSERT INTO todo_app.todos (task, completed, date_updated)
VALUES ('Part 3', False, null);
INSERT INTO todo_app.todos (task, completed, date_updated)
VALUES ('Part 4', False, null);
INSERT INTO todo_app.todos (task, completed, date_updated)
VALUES ('Part 5', False, null);
INSERT INTO todo_app.todos (task, completed, date_updated)
VALUES ('Part 6', False, null);

Choose a reason for hiding this comment

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

This can be simplified to:

insert into todo_app.todos (task, completed, date_updated)
values
    ('Part 1', true, null),
    ('Part 2', false, null),
    ...

Choose a reason for hiding this comment

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

This won't error if we don't have seed data; verify only fails if there's an error. We could check the count of the query is greater than 0.

Choose a reason for hiding this comment

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

Same as the previous comment.

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