Open
Conversation
add nodes to connection
|
@a8m (sorry for the direct tag) any chance of getting a review or feedback on this, we would also like to be able to use this feature. |
github-merge-queue bot
pushed a commit
to infratographer/x
that referenced
this pull request
Jul 30, 2025
This adds a `nodes` field to relay connections. With this added it
allows GraphQL queries like this:
```
location(id: $id) {
id
name
devices {
nodes {
id
name
}
}
}
```
Which makes it easier to loop through results instead of having to loop
through the `edges` and then `node` to get the actual list of nodes.
This is similar to how GitHub and other public GraphQL APIs provide
things through the relay connection.
This is entirely based off of ent/contrib#602 and can be removed once we
are on a release that includes that PR.
Signed-off-by: Nicole Hubbard <code@nicole.dev>
github-merge-queue bot
pushed a commit
to infratographer/x
that referenced
this pull request
Aug 6, 2025
The upstream PR ent/contrib#602 appears to have missed adding the check for the `nodes` field being used in the collections template. This is used when you call a collection from another collection, for example: ``` query { loadBalancer(id: "lb-123"){ ports { nodes { pools { nodes { id } } } } } } ``` Before this fix the `pools.nodes` would come back as an empty list, with this fix it's properly filled out. Signed-off-by: Nicole Hubbard <code@nicole.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.