Skip to content
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

GraphQL fails to show ProviderNetworks in Interface connected_endpoints #14511

Closed
bogi788 opened this issue Dec 13, 2023 · 2 comments · Fixed by #14930
Closed

GraphQL fails to show ProviderNetworks in Interface connected_endpoints #14511

bogi788 opened this issue Dec 13, 2023 · 2 comments · Fixed by #14930
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation topic: GraphQL type: bug A confirmed report of unexpected behavior in the application

Comments

@bogi788
Copy link

bogi788 commented Dec 13, 2023

Deployment Type

Self-hosted

NetBox Version

v3.6.6

Python Version

3.11

Steps to Reproduce

When performing GraphQL queries on interfaces the connected_endpoints property fails to "expand" when connected to ProviderNetwork objects (via circuits).

Editing dcim/graphql/gfk_mixins.py and adding ProviderNetwork/ProviderNetworkType to LinkPeerType allows the query to succeed.

Expected Behavior

The GraphQL API should include all supported connected_endpoints types or the cable trace (for GraphQL) stop at the CircuitTermination that is already listed in the schema for LinkPeerType.

Observed Behavior

The query

query{
  interface_list(...) {
    id
    connected_endpoints{
      ... on CircuitTerminationType{
        id
      }
    }
  }
}

results in the following error message via the GraphQL API:

Abstract type 'LinkPeerType' must resolve to an Object type at runtime for field 'InterfaceType.connected_endpoints'. Either the 'LinkPeerType' type should provide a 'resolve_type' function or each possible type should provide an 'is_type_of' function.

@bogi788 bogi788 added the type: bug A confirmed report of unexpected behavior in the application label Dec 13, 2023
@jeremystretch jeremystretch added topic: GraphQL status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Dec 13, 2023
@jeremystretch
Copy link
Member

@Zaptho @pzoppoth @fstolba @anx-mpraxmarer @rwielk @Gaste8 you were all very quick to 👍 this issue. Would any of you like to volunteer to fix it?

@bogi788
Copy link
Author

bogi788 commented Dec 15, 2023

https://github.com/bogi788/netbox/tree/14511-graphql-connected-endpoints contains the fix I've been using, but I'm unsure if adding a new type is the correct approach.

@arthanson arthanson self-assigned this Jan 24, 2024
@arthanson arthanson removed the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Jan 24, 2024
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Jan 25, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation topic: GraphQL type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants