-
Notifications
You must be signed in to change notification settings - Fork 18
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
Reverse GraphQL is not supported #450
Comments
Hi @sirtux, that's actually an interesting one, though probably nothing I can do anything about. First, let's look at the GraphQL docs for Apparently there isn't an element for @strawberry_django.type(
models.Tenant,
fields='__all__',
filters=TenantFilter
)
class TenantType(NetBoxObjectType):
group: Annotated["TenantGroupType", strawberry.lazy('tenancy.graphql.types')] | None
asns: List[Annotated["ASNType", strawberry.lazy('ipam.graphql.types')]]
circuits: List[Annotated["CircuitType", strawberry.lazy('circuits.graphql.types')]]
sites: List[Annotated["SiteType", strawberry.lazy('dcim.graphql.types')]]
vlans: List[Annotated["VLANType", strawberry.lazy('ipam.graphql.types')]]
wireless_lans: List[Annotated["WirelessLANType", strawberry.lazy('wireless.graphql.types')]]
route_targets: List[Annotated["RouteTargetType", strawberry.lazy('ipam.graphql.types')]]
locations: List[Annotated["LocationType", strawberry.lazy('dcim.graphql.types')]]
ip_ranges: List[Annotated["IPRangeType", strawberry.lazy('ipam.graphql.types')]]
rackreservations: List[Annotated["RackReservationType", strawberry.lazy('dcim.graphql.types')]]
racks: List[Annotated["RackType", strawberry.lazy('dcim.graphql.types')]]
vdcs: List[Annotated["VirtualDeviceContextType", strawberry.lazy('dcim.graphql.types')]]
prefixes: List[Annotated["PrefixType", strawberry.lazy('ipam.graphql.types')]]
cables: List[Annotated["CableType", strawberry.lazy('dcim.graphql.types')]]
virtual_machines: List[Annotated["VirtualMachineType", strawberry.lazy('virtualization.graphql.types')]]
vrfs: List[Annotated["VRFType", strawberry.lazy('ipam.graphql.types')]]
asn_ranges: List[Annotated["ASNRangeType", strawberry.lazy('ipam.graphql.types')]]
wireless_links: List[Annotated["WirelessLinkType", strawberry.lazy('wireless.graphql.types')]]
aggregates: List[Annotated["AggregateType", strawberry.lazy('ipam.graphql.types')]]
power_feeds: List[Annotated["PowerFeedType", strawberry.lazy('dcim.graphql.types')]]
devices: List[Annotated["DeviceType", strawberry.lazy('dcim.graphql.types')]]
tunnels: List[Annotated["TunnelType", strawberry.lazy('vpn.graphql.types')]]
ip_addresses: List[Annotated["IPAddressType", strawberry.lazy('ipam.graphql.types')]]
clusters: List[Annotated["ClusterType", strawberry.lazy('virtualization.graphql.types')]]
l2vpns: List[Annotated["L2VPNType", strawberry.lazy('vpn.graphql.types')]] So the list of related objects that can be referenced is apparently hard-coded. The only way this could be solved would be to override the |
I opened a NetBox FR, let's see what happens: netbox-community/netbox#17826 |
Turned out there is another issue with the same scope: netbox-community/netbox#17242 |
@sirtux netbox-community/netbox#17242 seems go gain momentum, so it might be a good moment to show interest in getting it fixed. |
Update: This is now officially a NetBox bug: netbox-community/netbox#18435 |
Versions
NetBox Version: 4.1.4
NetBox DNS Version: 1.1.4
Python Version: 3.12.3
Describe the bug
When using the GraphQL API, I can only do forward searches, e.g.:
query { netbox_dns_nameserver_list { tenant { name } } }
however, the reverse is not availabe:
query { tenant_list { netbox_dns_nameserver { id } } }
To Reproduce
Steps to reproduce the behavior:
query { tenant_list { netbox_dns_nameserver { id } } }
Expected result
I expect to get a list for nameservers for each tenant.
Actual result
"Cannot query field 'netbox_dns_nameserver' on type 'TenantType'."
Thanks!
The text was updated successfully, but these errors were encountered: