Skip to content

Commit

Permalink
chore: update docs for pgSelectSingle.record() (#2052)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored May 9, 2024
2 parents 6124725 + a4d9884 commit ed93d78
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions grafast/website/grafast/step-library/dataplan-pg/pgSelect.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,24 @@ Returns a `pgSelect` representing the records related via the

Returns a PgClassExpressionStep representing the entire table, useful for debugging or to use with `pgSelectSingleFromRecord`.

Here's a debugging example, we log out the full record to make sure it's the one we wanted:

```ts
const plans = {
Query: {
getUserById(_, { $id }) {
const $user = usersResource.get({ id: $id });

// Get the full user object as a record and log it for debugging:
const $record = $user.record();
sideEffect($record, (user) => console.dir(user));

return $user;
},
},
};
```

### $pgSelectSingle.cursor()

Returns a step representing the cursor of this row, typically used for
Expand Down

0 comments on commit ed93d78

Please sign in to comment.