pynetbox icon indicating copy to clipboard operation
pynetbox copied to clipboard

Feature request: GraphQL support

Open Kani999 opened this issue 3 years ago • 2 comments

Hello,

is there a planned GraphQL queries implementation since Netbox 3.0 support this feature? GraphQL is not part of '/api' endpoint but it has own 'graphql/' path.

Is it possible to implement the GraphQL queries into the pynetbox?

Thank you

Kani999 avatar Sep 17 '21 11:09 Kani999

:wave: I hadn't really planned on including it. Mostly because there's plenty of well-support GQL libraries out there already, and I'm not that interested in making another one. I don't really think the value pynetbox adds to NetBox's REST API is there with something as expressive as graphql, but maybe I'm just not seeing it.

Happy to leave this issue open for a while to see if others feel differently.

zachmoody avatar Sep 23 '21 03:09 zachmoody

I'd actually like to bring this back up. I was more in the same mind as @zachmoody

Recently I came across nautobot ansible variable management at scale

I would frankly want to implement this same sort of feature in netbox ansible modules. We have an issue already for this

  • netbox-community/ansible_modules#566

ryanmerolle avatar Apr 08 '22 14:04 ryanmerolle

IMHO GraphQL support is outside the scope of this project - this is specifically for RestAPI and GraphQL would be completely separate. I'd suggest creating a separate library.

arthanson avatar Nov 18 '22 19:11 arthanson

I am moving from the REST API to GraphQL and as such would need Ansible integration for NetBox GraphQL.

Nautobot provides the GraphQL Ansible lookup that I need which under the hood uses the pynautobot GraphQL features.

If @arthanson feel GraphQL is not a fit for this project then I'd be interested in creating a new project for it. So I have a few questions and I hope you do not mind me abusing this thread for it:

  1. What forum should be used to discuss a new pynetboxgql (or whatever the name) project?
  2. In this thread there is interest in GraphQL feature for pynetbox, would they be interested in being involved in this new project?
  3. Similarly for netbox.netbox Ansible module, I guess it could be called netbox.graphql and the features I'd be mostly interested in would be a lookup plugin.

Unfortunately Python is not an interest of mine (at all) but I'm pretty sure I could get something off the ground.

Since this thread is currently the only forum where interest has been shown I took this initiative. We can move it initially to discussions here or elsewhere. First I'd like to gauge the interest within the participants here and I hope this issue would not need to be locked until we have a clear path forward.

bluikko avatar Apr 11 '23 05:04 bluikko