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: Add device_type as a filter for device_list / device #9584

Closed
ryanmerolle opened this issue Jun 22, 2022 · 2 comments · Fixed by #10630
Closed

GraphQL: Add device_type as a filter for device_list / device #9584

ryanmerolle opened this issue Jun 22, 2022 · 2 comments · Fixed by #10630
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@ryanmerolle
Copy link
Contributor

ryanmerolle commented Jun 22, 2022

NetBox version

v3.2.5

Feature type

Change to existing functionality

Proposed functionality

Currently, you can only filter device_type_id in the graphql filters. It would be good to filter on either the slug or the name of device_type. It actually looks like this function is missing from the normal rest api also.

Current way to filter on device_type:

{
  device_list(device_type_id: "11") {
    id
    name
    device_type {
      id
    }
  }
}

Requested approach:

{
  device_list(device_type: "<insert slug OR model>") {
    id
    name
    device_type {
      id
    }
  }
}

Use case

Often individuals do not know the id, so its hard to pass said value if you do not know it.

Frankly this just further sets graphql API standardization since this is already supported for device_role (you can filter on it like below):

{
  device_list(role: "patch-panel") {
    id
    name
    device_type {
      id
      model
      slug
    }
    device_role {
      id
      slug
    }
  }
}

Database changes

N/A

External dependencies

N/A

@ryanmerolle ryanmerolle added the type: feature Introduction of new functionality to the application label Jun 22, 2022
@jeremystretch jeremystretch added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Jun 23, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Aug 23, 2022
@jeremystretch
Copy link
Member

Blocked by #9856

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation pending closure Requires immediate attention to avoid being closed for inactivity labels Aug 25, 2022
@jeremystretch jeremystretch added status: under review Further discussion is needed to determine this issue's scope and/or implementation and removed status: blocked Another issue or external requirement is preventing implementation labels Sep 27, 2022
@arthanson arthanson self-assigned this Oct 4, 2022
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Oct 20, 2022
jeremystretch added a commit that referenced this issue Oct 20, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants