Component
No response
Infrahub SDK version
1.19.0
Current Behavior
GQL:
Device {
edges {
node {
__typename
id
ip {
ip
}
}
}
Data:
{
"data": {
"Device": {
"edges": [
{
"node": {
"ip": {
"ip": null
}
}
}
}
Error:
File "C:\Users\justin.jeffery\Code\infrahub-avd\.venv\Lib\site-packages\infrahub_sdk\node\attribute.py", line 82, in __init__
self._value = mapper(data.get("value"))
~~~~~~^^^^^^^^^^^^^^^^^^^
File "C:\Users\justin.jeffery\AppData\Local\Programs\Python\Python313\Lib\ipaddress.py", line 117, in ip_interface
raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 interface')
ValueError: {'ip': None} does not appear to be an IPv4 or IPv6 interface
Expected Behavior
If an Attribute of kind IPHost is optional and has no value the GQL works fine with querying the value but if querying the ip instead it should also return None and not error. This means all my queries I either:
- Cannot use converted response.
- Or have to query the value, check if it is None, then manually split the mask off.
This may also apply to IPNetwork items as well.
Steps to Reproduce
- Create schema with IPHost Attribute
- Create Query extracting only the IP and not the value
- Use the converted resposne in the SDK
Additional Information
No response
Component
No response
Infrahub SDK version
1.19.0
Current Behavior
GQL:
Data:
Error:
Expected Behavior
If an Attribute of kind
IPHostis optional and has no value the GQL works fine with querying the value but if querying theipinstead it should also return None and not error. This means all my queries I either:This may also apply to
IPNetworkitems as well.Steps to Reproduce
Additional Information
No response