Add disclaimer regarding usage of direct foreign key values #5683
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe this PR
The examples section of the
connect
nested query page currently indicates that you can set foreign keys directly.However, when you try to use both the direct way of setting a foreign key and the
connect
query, you get a type error, due to the fact that it is unpractical to generate types for every combination of inputs using direct assignment andconnect
, as described in this issue comment.Since this behavior is intentional, and the error you get when trying to combine both approaches isn't very clear, I realized a note on the documentation could prevent some people stumbling on this problem.
Changes
Added a short disclaimer explaining that you can only use one of the two approaches in the same query (the sentence after the code example).
What issue does this fix?
Not applicable.
Any other relevant information
I decided to link the main repository's relevant issue to the docs rather than explaining the reasoning behind the limitation, because I figured the disclaimer would get too long otherwise. Please feel free to improve on the disclaimer in case it isn't optimal as is.