-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(docs): update TodoList tutorial #4126
Conversation
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.
Thanks for adding the usage of relation generator to the tutorial! Mostly LGTM, just have some comments.
#### Inclusion of Related Models | ||
|
||
When running the `lb4 relation` command, the prompt below registers the | ||
inclusionResolver for this belongsTo relation for you. |
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.
inclusionResolver -> inclusionResolver
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.
Here it seems we are asking user to run it again.
When running the
lb4 relation
command, the prompt below registers the
inclusionResolver for this belongsTo relation for you.
We need to rewrite this paragraph in the proper tense.
Perhaps something like:
When we ran the lb4 relation
commands above, we accepted the default of Yes
to the prompt:
? Allow Order queries to include data from related Customer instances? (Y/n)
This registered the inclusionResolver for the relation(s) you were working with above.
Make sure to chose yes
...
|
||
#### Relation decorators | ||
|
||
When specifying the `hasMany` relation, it adds `@hasMany()` decorator defines |
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.
When specifying the
hasMany
relation, it adds@hasMany()
decorator defines this property.
What are we trying to say here?
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.
trying to say when running the lb4 relation
command, the decorator was added to the property. Let me do some rewording here.
#### Inclusion of Related Models | ||
|
||
When running the `lb4 relation` command, the prompt below registers the | ||
inclusionResolver for this belongsTo relation for you. |
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.
Here it seems we are asking user to run it again.
When running the
lb4 relation
command, the prompt below registers the
inclusionResolver for this belongsTo relation for you.
We need to rewrite this paragraph in the proper tense.
Perhaps something like:
When we ran the lb4 relation
commands above, we accepted the default of Yes
to the prompt:
? Allow Order queries to include data from related Customer instances? (Y/n)
This registered the inclusionResolver for the relation(s) you were working with above.
Make sure to chose yes
...
|
||
On the other end, | ||
[`BelongsToAccessor`](https://loopback.io/doc/en/lb4/apidocs.repository.belongstoaccessor.html) | ||
also comes with an inclusion resolver property that we can register on the |
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.
nitpick: I feel a more accurate word is function
instead of property
.
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.
changed it to function
.
When specifying the `hasMany` relation, it adds `@hasMany()` decorator defines | ||
this property. As the decorator's name suggests, `@hasMany()` informs LoopBack 4 | ||
that a todo list can have many todo items. | ||
When we added the `hasMany` relation using the `lb4 relation` command, it added |
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.
When we added the
hasMany
relation using thelb4 relation
command, it added
@hasMany()
decorator defines this property
When we added the hasMany
relation using the lb4 relation
command, it added the
@hasMany()
decorator which
defines this property . (Is this what we want to say?)
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.
actually, it added the property + the decorator. How about:
When we added the hasMany
relation using the lb4 relation
command, it added the
@hasMany()
decorator together with the todo
property.
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.
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.
Also, we still need a the
before '@hasmany decorator'
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.
it should be todos
property (the one in the documentation is correct).
OK. how about this:
When we added the hasMany
relation using the lb4 relation
command, it added
the @hasMany()
decorator together with the todos
property.
When specifying the `hasMany` relation, it adds `@hasMany()` decorator defines | ||
this property. As the decorator's name suggests, `@hasMany()` informs LoopBack 4 | ||
that a todo list can have many todo items. | ||
When we added the `hasMany` relation using the `lb4 relation` command, it added |
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.
When specifying the `hasMany` relation, it adds `@hasMany()` decorator defines | ||
this property. As the decorator's name suggests, `@hasMany()` informs LoopBack 4 | ||
that a todo list can have many todo items. | ||
When we added the `hasMany` relation using the `lb4 relation` command, it added |
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.
Also, we still need a the
before '@hasmany decorator'
@emonddr, I've pushed my changes and squashed all the commits. PTAL again. Thanks! |
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.
:)
Fixes #3742
Now that we have
lb4 relation
command, we need to update the TodoList tutorial to remove the manual steps because those are taken care by the relation generator command.hasOne
portion but since we don't have thehasOne
option available onlb4 relation
(see Add hasOne relation type tolb4 relation
#2980), I didn't update the tutorial to include that.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈