Skip to content

Contacts not returned for ASN via graphql API #20507

@matthew-242

Description

@matthew-242

NetBox version

4.4.2

Feature type

New functionality

Proposed functionality

It appears that when contacts were added to ASNs (https://github.com/netbox-community/netbox/pull/19981/files#diff-4419495314f6a8489168ea67c5790e89a976d66701250e3d2497f1561dcb781f) that it didn't include adding this data to the graphql responses.

I am by no means an expert in graphql or the Django Stawberry GraphQL library, but it appears this is a trivial fix to update netbox/netbox/ipam/graphql/types.py from this:

class ASNType(NetBoxObjectType):

to:
class ASNType(NetBoxObjectType, ContactsMixin):

I have tested this locally and it appears to resolve the issue, and I can now get the contacts returned via the graphql API.

Happy to raise a PR if this acceptable.

(Please note I didn't see any other issues relating to this, so apologies if I missed something and it is a duplicate)

Use case

Allow graphql APIs users to get access to contacts for ASNs.

Database changes

No response

External dependencies

No response

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions