Skip to content

bug: isnull filters are missing in the schema endpoint #30

@wvandeun

Description

@wvandeun

Component

API Server / GraphQL, Python SDK

Infrahub version

0.16.0

Current Behavior

As part of the schema, Infrahub currently exposes the list of supported filters.

For relationships an isnull filter is generated that allows us to filter for nodes that either have a related node for that relationship or not. These filters are usable when using the GraphQL API.

When you consult the schema of a node, using the schema REST API endpoint, the isnull filters are missing from the schema.

This means we cannot use these filters in the SDK, as the SDK validates the filters you can using the filters returned by the schema endpoint.

Expected Behavior

The isnull filters should be part of the filters returned by the schema REST API endpoint.
The SDK will allow us to you use the isnull filters.

Steps to Reproduce

  • load instance of Infrahub
  • load the demo schema and data
  • use http://localhost:8000/api/schema/InfraDevice, notice that the isnull filter is missing for site, primary_address, interfaces, platform...
  • open a Python interpreter and execute the following snippet
from infrahub_sdk import InfrahubClientSync
client = InfrahubClientSync()
client.filters("InfraDevice", primary_address__isnull: True)

Additional Information

No response

Metadata

Metadata

Assignees

Labels

type/bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions