Some GraphQL Queries for Relationships fail on 1.2
See original GitHub issueEnvironment
- Python version: 3.8
- Nautobot version: 1.2.2
Steps to Reproduce
- Have a relationship e.g. between cluster and devices (one to many)
- Run a graphql query like:
device(id:"bb91df1c-61ec-4a85-8138-cdb97c6c890e")
{
name
rel_cluster_to_device{
id
}
}
}
Expected Behavior
Get the ID of the relationship
Observed Behavior
{
"errors": [
{
"message": "Cannot call only() after .values() or .values_list()",
"locations": [
{
"line": 5,
"column": 3
}
],
"path": [
"device",
"rel_cluster_to_device"
]
}
],
"data": {
"device": {
"name": "R10-S3",
"rel_cluster_to_device": null
}
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
GraphQL query best practices
Use GraphQL variables to provide arguments ... The first query uses a variable ( $dogId ) for the value of the dog field's...
Read more >GraphQL specification
GraphQL describes the types of data expected by query variables. Input types may be lists of another input type, or a non‐null variant...
Read more >Solved: GraphQL @Cypher Query Error - Neo4j - 25746
Solved: **I have a simple graph of Part nodes and CHILD_OF relationships. There is a property "index" on the "CHILD_OF" - 25746.
Read more >Hairy - GraphQL Rules
For GraphQL fragments working fine on the client, you need a server that will indicate in the scheme as many relationships as possible...
Read more >Nautobot Relationships Part 2 | The NTC Mag
Query Relationship Association. Nautobot's GraphQL implementation supports querying custom-defined relationships (and their associations) using ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @glennmatthews, I just tried the fix from #1230, and it looks good - I just wait for confirmation from @manawyrm to confirm that.
Do you think this fix can make it into a 1.2.4?
Thanks, Tom
Also it’s worth noting that the inner
id
field returned by this query is not the ID of the RelationshipAssociation model instance, it’s the ID of the object on the other end of the relationship association (e.g. the Cluster object ID in your example above). Just wanted to make that clear because it tripped me up as well. 😃