question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restart required to view new Relationship in GraphQL

See original GitHub issue

Environment

  • Python version: 3.8.5
  • Nautobot version: 1.0.1

Steps to Reproduce

  1. Create a new Relationship e.g. between dcim.device and ipam.vlan called device_vlan
  2. Go to the GraphiQL interface
  3. Query for all devices and include the relationship attribute created in step 1 e.g.
{
  devices{
    rel_device_vlan {
      id
    }
  }
}

Expected Behavior

The relationship attribute (e.g. rel_device_vlan) is available for selection the GraphIQL interface and is processed and values returned as part of the query.

Observed Behavior

The relationship attribute (e.g. rel_device_vlan) is not available on the models as per definition. If the relationship attribute is entered into the query without predictive text, the error below is reported.

The nautobot service needs to be restarted for the relationship to be loaded and be available for querying.

{
  "errors": [
    {
      "message": "Cannot query field \"rel_device_vlan\" on type \"DeviceType\".",
      "locations": [
        {
          "line": 37,
          "column": 5
        }
      ]
    }
  ]
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
glennmatthewscommented, Jul 26, 2021

Probably also an issue with other “dynamic” schema content - custom fields, computed fields in particular.

0reactions
glennmatthewscommented, Jan 7, 2022

Note that the test case test_query_relationship_associations in nautobot/core/tests/test_graphql.py (added by #1230) is currently skipped due to this issue. When this issue is fixed, that test case should be re-enabled and validated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL schema stitching
In this article I'd like to present a new way GraphQL can help you describe your data and make it more easily accessible....
Read more >
Five Common Problems in GraphQL Apps (And How to Fix ...
Solution: GraphQL Schema Generation​​ A number of solutions to this problem have emerged in the GraphQL ecosystem. For example, PostGraphile ...
Read more >
Graphql-ruby: Need to restart Rails server every time when ...
When I make changes to the graphql query_type or any other graphql related files such as(graphql_controller, type files, etc), I need to ...
Read more >
A Practical GraphQL Getting Started Guide with Node.js and ...
js that will require restarting the node server to reflect the latest changes. Visit localhost:4000/graphql in a web browser. You will see a ......
Read more >
Table permissions and relationships are reverted after some time ...
I have created new table, and update the permissions and relationships with other tables. ... If you do not export your metadata, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found