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 alias filter affects all properties of the same type #18157

Open
TribuneX opened this issue Dec 4, 2024 · 0 comments
Open

GraphQL alias filter affects all properties of the same type #18157

TribuneX opened this issue Dec 4, 2024 · 0 comments
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation topic: GraphQL type: bug A confirmed report of unexpected behavior in the application

Comments

@TribuneX
Copy link

TribuneX commented Dec 4, 2024

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.7

Python Version

3.12

Steps to Reproduce

It seems, that I cannot use a single alias filter within a query, since it will also have an undesired effect on subsequent properties of the same type. The same applies if I use multiple aliases in the same query. The first one always wins.

See the following demo query done on the NetBox demo instance:

query aliasOnInterface {
  device(id: 1) {
    name
    lags: interfaces(filters: { type: { exact: "lag" } }) {
      name
    }
    interfaces {
      name
    }
  }
}

Expected Behavior

{
  "data": {
    "device": {
      "name": "dmi01-akron-rtr01",
      "lags": [
        {
          "name": "Po1"
        }
      ],
      "interfaces": [
        {
          "name": "GigabitEthernet0/0/0"
        },
        {
          "name": "GigabitEthernet0/0/1"
        },
        {
          "name": "GigabitEthernet0/1/0"
        },
        {
          "name": "GigabitEthernet0/1/1"
        },
        {
          "name": "GigabitEthernet0/1/2"
        },
        {
          "name": "GigabitEthernet0/1/3"
        },
        {
          "name": "GigabitEthernet0/1/4"
        },
        {
          "name": "GigabitEthernet0/1/5"
        },
        {
          "name": "GigabitEthernet0/1/6"
        },
        {
          "name": "GigabitEthernet0/1/7"
        },
        {
          "name": "GigabitEthernet0/1/8"
        },
        {
          "name": "Wlan-GigabitEthernet0/1/8"
        },
        {
          "name": "Cellular0/2/0"
        },
        {
          "name": "Po1"
        }
      ]
    }
  }
}

Observed Behavior

{
  "data": {
    "device": {
      "name": "dmi01-akron-rtr01",
      "lags": [
        {
          "name": "Po1"
        }
      ],
      "interfaces": [
        {
          "name": "Po1"
        }
      ]
    }
  }
}
@TribuneX TribuneX added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Dec 4, 2024
@arthanson arthanson added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation topic: GraphQL severity: low Does not significantly disrupt application functionality, or a workaround is available and removed status: needs triage This issue is awaiting triage by a maintainer labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation topic: GraphQL type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants