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 filter arguments at all levels #248

Closed
dgarros opened this issue Apr 6, 2021 · 3 comments · Fixed by #799
Closed

GraphQL : Add filter arguments at all levels #248

dgarros opened this issue Apr 6, 2021 · 3 comments · Fixed by #799
Assignees
Labels
type: feature Introduction of new or enhanced functionality to the application
Milestone

Comments

@dgarros
Copy link
Contributor

dgarros commented Apr 6, 2021

Environment

  • Python version: 3.7
  • Nautobot version: 1.0.0b2

Proposed Functionality

Add filter arguments at all levels for GraphQL
Currently, it's only possible to define filter arguments at the top level

Examples of currently supported queries

{
  devices(site: "ams") {
	id
        name
        interfaces {
           name
    }
  }
  interfaces(name:"Ethernet1", site:"ams") {
    name
  }
}

Proposed query, currently not supported

{
    devices(site: "ams") {
	id
        name
        interfaces(name:"Ethernet1") { <<<<<
            name
    }
  }
}

Use Case

Have a more powerful query engine that will be able to return only the correct results

Database Changes

No

External Dependencies

No

@glennmatthews glennmatthews added the type: feature Introduction of new or enhanced functionality to the application label Apr 6, 2021
@jathanism
Copy link
Contributor

jathanism commented Apr 6, 2021

Tried as I might to address this in #246, I could not get it working and it appears that it will require the use of Relay nodes or filter connections (or both) to make it work.

It might be possible to get it working by leveraging some of the extra filterset/serializers/models types found in graphene-django-extras but it's going to take some trial and error seeing as the documentation for both projects is sparse at best when it comes to advanced filtering patterns.

@jathanism jathanism added this to the v1.1.0 milestone Apr 6, 2021
@jathanism jathanism added the status: help wanted Extra attention is needed label Apr 6, 2021
@jedelman8 jedelman8 removed this from the v1.1.0 milestone Jun 21, 2021
@itdependsnetworks
Copy link
Contributor

Adding the terms nested graphql query for better searching in the future.

@glennmatthews
Copy link
Contributor

Implemented in next by #799.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new or enhanced functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants