Skip to content

bug: execute_graphql does not consider default_branch setting on InfrahubClient #46

@wvandeun

Description

@wvandeun

Component

Python SDK

Infrahub SDK version

0.13.1

Current Behavior

The execute_graphql method of InfrahubClient does not consider the default_branch setting on InfrahubClient.

Expected Behavior

execute_graphql executes the the graphql query in the branch that is set as default_branch

Steps to Reproduce

  • Spin up an instance of Infrahub
  • Create a branch test
  • Create a BuiltinTag node in the test branch
  • Run the following script
from infrahub_sdk import InfrahubClientSync, Config
client = InfrahubClientSync(config=Config(default_branch="test"))
client.execute_graphql(query="query { BuiltinTag { count }}") # result count will be 0
client.execute_graphql(query="query { BuiltinTag { count }}", branch_name="test") # result count will be 1

Additional Information

The branch_name argument that you can use seems to deviate from how we typically name this argument in other methods in the SDK. Typically the name would be branch.

Metadata

Metadata

Assignees

No one assigned

    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