GraphQL: timezone inconsistent with REST API #5483

Closed
opened 2025-12-29 19:28:32 +01:00 by adam · 9 comments
Owner

Originally created by @arjenvri on GitHub (Oct 6, 2021).

Originally assigned to: @ryanmerolle on GitHub.

NetBox version

v3.0.5

Python version

3.7

Steps to Reproduce

  1. Open the GraphiQL explorer
  2. Run the below query
  query {
    site_list(
      id: "454")
     {
      name
      time_zone
    }

  }

Expected Behavior

GraphQL returns timezones as

AFRICA_LUBUMBASH
AMERICA_CAMPO_GRANDE

Observed Behavior

The RESTAPI returns timezones in format

Africa/Lubumbashi
America/Campo Grande

For backwards compatibility it would be useful to return the same format or at least provide an option to do so if possible.

Originally created by @arjenvri on GitHub (Oct 6, 2021). Originally assigned to: @ryanmerolle on GitHub. ### NetBox version v3.0.5 ### Python version 3.7 ### Steps to Reproduce 1. Open the GraphiQL explorer 2. Run the below query ``` query { site_list( id: "454") { name time_zone } } ``` ### Expected Behavior GraphQL returns timezones as AFRICA_LUBUMBASH AMERICA_CAMPO_GRANDE ### Observed Behavior The RESTAPI returns timezones in format Africa/Lubumbashi America/Campo Grande For backwards compatibility it would be useful to return the same format or at least provide an option to do so if possible.
adam added the type: bugstatus: accepted labels 2025-12-29 19:28:32 +01:00
adam closed this issue 2025-12-29 19:28:32 +01:00
Author
Owner

@ryanmerolle commented on GitHub (Oct 13, 2021):

Here is an updated view of the issue and a link to the results on the demo site.

NetBox version

v3.0.7

Python version

3.8

Steps to Reproduce

graphql query reproducible via https://demo.netbox.dev/graphql/#query=%7B%0A%20%20site_list(id%3A%20%2231%22)%20%7B%0A%20%20%20%20name%0A%20%20%20%20id%0A%20%20%20%20time_zone%0A%20%20%7D%0A%7D%0A

{
  site_list(id: "31") {
    name
    id
    time_zone
  }
}

Expected Behavior

{
  "data": {
    "site_list": [
      {
        "name": "UPRC Digital Systems - Athens",
        "id": "31",
        "time_zone": "EUROPE_ATHENS"
      }
    ]
  }
}

Observed Behavior

{
  "data": {
    "site_list": [
      {
        "name": "UPRC Digital Systems - Athens",
        "id": "31",
        "time_zone": "Europe/Athens"
      }
    ]
  }
}
@ryanmerolle commented on GitHub (Oct 13, 2021): Here is an updated view of the issue and a link to the results on the demo site. ### NetBox version v3.0.7 ### Python version 3.8 ### Steps to Reproduce graphql query reproducible via https://demo.netbox.dev/graphql/#query=%7B%0A%20%20site_list(id%3A%20%2231%22)%20%7B%0A%20%20%20%20name%0A%20%20%20%20id%0A%20%20%20%20time_zone%0A%20%20%7D%0A%7D%0A ``` { site_list(id: "31") { name id time_zone } } ``` ### Expected Behavior ``` { "data": { "site_list": [ { "name": "UPRC Digital Systems - Athens", "id": "31", "time_zone": "EUROPE_ATHENS" } ] } } ``` ### Observed Behavior ``` { "data": { "site_list": [ { "name": "UPRC Digital Systems - Athens", "id": "31", "time_zone": "Europe/Athens" } ] } } ```
Author
Owner

@ryanmerolle commented on GitHub (Oct 15, 2021):

I found another:

{
  interface_template_list(id: "126"){
    id
    name
    type
  }
}

In this case type is not matching the API.

@ryanmerolle commented on GitHub (Oct 15, 2021): I found another: ``` { interface_template_list(id: "126"){ id name type } } ``` In this case type is not matching the API.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 15, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Dec 15, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@ryanmerolle commented on GitHub (Dec 15, 2021):

I think some of the graphql response need to be formatted more inline with the REST responses.

@ryanmerolle commented on GitHub (Dec 15, 2021): I think some of the graphql response need to be formatted more inline with the REST responses.
Author
Owner

@jeremystretch commented on GitHub (Dec 15, 2021):

Why would it matter? The two are entirely independent APIs. GraphQL seems to like defining constants for choice fields, so I'm not sure this even qualifies as a bug.

@jeremystretch commented on GitHub (Dec 15, 2021): Why would it matter? The two are entirely independent APIs. GraphQL seems to like defining constants for choice fields, so I'm not sure this even qualifies as a bug.
Author
Owner

@ryanmerolle commented on GitHub (Dec 29, 2021):

Not sure that its a bug, just a lack of parity given people moving from REST API to GraphQL will notice a lack of parity for items like this. We can reclassify this as a FR if you prefer.

@ryanmerolle commented on GitHub (Dec 29, 2021): Not sure that its a bug, just a lack of parity given people moving from REST API to GraphQL will notice a lack of parity for items like this. We can reclassify this as a FR if you prefer.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 28, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Feb 28, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@ryanmerolle commented on GitHub (Mar 1, 2022):

The fact that the graphql api does not match the output of the ui and rest api is not ideal, but I get a sense it's not a priority or a good ROI. I'll retry to look into this a little more next week.

@ryanmerolle commented on GitHub (Mar 1, 2022): The fact that the graphql api does not match the output of the ui and rest api is not ideal, but I get a sense it's not a priority or a good ROI. I'll retry to look into this a little more next week.
Author
Owner

@jeremystretch commented on GitHub (Jul 27, 2022):

I'm going to close this out both because no work has been done and because it will likely become moot per #9856.

@jeremystretch commented on GitHub (Jul 27, 2022): I'm going to close this out both because no work has been done and because it will likely become moot per #9856.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5483