[PR #20014] [MERGED] Fixes #19622: Allow loading graphql query from URL in GraphiQL #15793

Closed
opened 2025-12-30 00:24:06 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20014
Author: @mraerino
Created: 8/3/2025
Status: Merged
Merged: 8/4/2025
Merged by: @jnovinger

Base: mainHead: graphql-query-arg


📝 Commits (1)

  • 1025f08 Allow loading graphql query from URL

📊 Changes

1 file changed (+17 additions, -0 deletions)

View changed files

📝 netbox/templates/graphql/graphiql.html (+17 -0)

📄 Description

Fixes: #19622

This adds the ability to populate the query in the built-in GraphQL IDE (GraphiQL) using a parameter specified in the URL hash (aka fragment).

E.g.

https://<your netbox>/graphql/#query=%7Bdevice_list%28filters%3A%7Binterfaces%3A%7Bip_addresses%3A%7Bfamily%3AFAMILY_6%7D%7D%7D%29%7Binterfaces%7Bip_addresses%7Baddress%20family%7Blabel%7D%7D%7D%7D%7D

I considered adding a button to copy this kind of url to the UI, but the project setup for GraphiQL (the UI component) is pretty outdated and doesn't easily allow modifications.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/20014 **Author:** [@mraerino](https://github.com/mraerino) **Created:** 8/3/2025 **Status:** ✅ Merged **Merged:** 8/4/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `graphql-query-arg` --- ### 📝 Commits (1) - [`1025f08`](https://github.com/netbox-community/netbox/commit/1025f08c11725d1a70a916ea56e5dfc318df07cc) Allow loading graphql query from URL ### 📊 Changes **1 file changed** (+17 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/templates/graphql/graphiql.html` (+17 -0) </details> ### 📄 Description ### Fixes: #19622 This adds the ability to populate the query in the built-in GraphQL IDE (GraphiQL) using a parameter specified in the URL hash (aka fragment). E.g. ``` https://<your netbox>/graphql/#query=%7Bdevice_list%28filters%3A%7Binterfaces%3A%7Bip_addresses%3A%7Bfamily%3AFAMILY_6%7D%7D%7D%29%7Binterfaces%7Bip_addresses%7Baddress%20family%7Blabel%7D%7D%7D%7D%7D ``` I considered adding a button to copy this kind of url to the UI, but the project setup for GraphiQL (the UI component) is pretty outdated and doesn't easily allow modifications. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:24:06 +01:00
adam closed this issue 2025-12-30 00:24:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15793