Skip to content

Part 3#17

Draft
andrea-williams wants to merge 9 commits intobcgov:mainfrom
andrea-williams:part_3
Draft

Part 3#17
andrea-williams wants to merge 9 commits intobcgov:mainfrom
andrea-williams:part_3

Conversation

@andrea-williams
Copy link

No description provided.

Copy link
Member

@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
}
}
}
}
}
```
Copy link
Member

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__/**"
]
Copy link
Member

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,
}),
});

Copy link
Member

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.

Copy link
Member

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);
Copy link
Member

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),
    ...

Copy link
Member

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.

Copy link
Member

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