Contacts not returned for ASN via graphql API #11692

Closed
opened 2025-12-29 21:48:40 +01:00 by adam · 2 comments
Owner

Originally created by @matthew-242 on GitHub (Oct 6, 2025).

Originally assigned to: @matthew-242 on GitHub.

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

Originally created by @matthew-242 on GitHub (Oct 6, 2025). Originally assigned to: @matthew-242 on GitHub. ### 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](url)) 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
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:48:40 +01:00
adam closed this issue 2025-12-29 21:48:40 +01:00
Author
Owner

@matthew-242 commented on GitHub (Oct 6, 2025):

Also apologies I made a bit of mess creating this issue by not selecting the template initially - sorry!

@matthew-242 commented on GitHub (Oct 6, 2025): Also apologies I made a bit of mess creating this issue by not selecting the template initially - sorry!
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2025):

Going to classify this as a bug as it describes expected behavior. I've assigned this to you @matthew-242, thanks!

@jeremystretch commented on GitHub (Oct 6, 2025): Going to classify this as a bug as it describes expected behavior. I've assigned this to you @matthew-242, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11692