GraphQL timezone doesn't match REST API #8062

Closed
opened 2025-12-29 20:31:51 +01:00 by adam · 6 comments
Owner

Originally created by @tagur87 on GitHub (May 15, 2023).

NetBox version

3.5.1

Python version

3.8

Steps to Reproduce

  1. Run curl to API endpoint and get the time_zone field from first result
curl -X 'GET' 'http://localhost:8001/api/dcim/sites/'  -H 'accept: application/json' -H 'Content-Type: application/json' \    
  -H 'Authorization: Token 0123456789abcdef0123456789abcdef01234567' | jq -r '.results[0].time_zone'

Asia/Dhaka
  1. Run curl to graphql endpoint for same
curl -X 'POST' 'http://localhost:8001/graphql/'  -H 'accept: application/json' -H 'Content-Type: application/json' \
  -H 'Authorization: Token 0123456789abcdef0123456789abcdef01234567' --data '{"query": "query{site_list{id time_zone}}"}' | jq -r '.data.site_list[0].time_zone' 

ASIA_DHAKA

Expected Behavior

The format of the time_zone field should be the same between the api and the graphql endpoints.

Observed Behavior

The time_zone field formatting is different between the api and graphql endpoints.

Originally created by @tagur87 on GitHub (May 15, 2023). ### NetBox version 3.5.1 ### Python version 3.8 ### Steps to Reproduce 1. Run curl to API endpoint and get the `time_zone` field from first result ``` curl -X 'GET' 'http://localhost:8001/api/dcim/sites/' -H 'accept: application/json' -H 'Content-Type: application/json' \ -H 'Authorization: Token 0123456789abcdef0123456789abcdef01234567' | jq -r '.results[0].time_zone' Asia/Dhaka ``` 2. Run curl to graphql endpoint for same ``` curl -X 'POST' 'http://localhost:8001/graphql/' -H 'accept: application/json' -H 'Content-Type: application/json' \ -H 'Authorization: Token 0123456789abcdef0123456789abcdef01234567' --data '{"query": "query{site_list{id time_zone}}"}' | jq -r '.data.site_list[0].time_zone' ASIA_DHAKA ``` ### Expected Behavior The format of the `time_zone` field should be the same between the api and the graphql endpoints. ### Observed Behavior The `time_zone` field formatting is different between the api and graphql endpoints.
adam added the type: bugtopic: GraphQL labels 2025-12-29 20:31:51 +01:00
adam closed this issue 2025-12-29 20:31:51 +01:00
Author
Owner

@tagur87 commented on GitHub (May 15, 2023):

Related to #11806 & #7466

@tagur87 commented on GitHub (May 15, 2023): Related to #11806 & #7466
Author
Owner

@jeremystretch commented on GitHub (May 15, 2023):

@tagur87 as this has already been discussed under #7466 and abandoned, re-opening the issue will require an owner. Are you willing to commit to doing this work?

@jeremystretch commented on GitHub (May 15, 2023): @tagur87 as this has already been discussed under #7466 and abandoned, re-opening the issue will require an owner. Are you willing to commit to doing this work?
Author
Owner

@tagur87 commented on GitHub (May 15, 2023):

@tagur87 as this has already been discussed under #7466 and abandoned, re-opening the issue will require an owner. Are you willing to commit to doing this work?

You mentioned originally:

I'm going to close this out both because no work has been done and because it will likely become moot per https://github.com/netbox-community/netbox/issues/9856.

However this never actually went through.

I don't have any ideas of where to start on this. Not sure why the difference? Is it b/c of different libraries used?

@tagur87 commented on GitHub (May 15, 2023): > @tagur87 as this has already been discussed under #7466 and abandoned, re-opening the issue will require an owner. Are you willing to commit to doing this work? You mentioned originally: >I'm going to close this out both because no work has been done and because it will likely become moot per https://github.com/netbox-community/netbox/issues/9856. However this never actually went through. I don't have any ideas of where to start on this. Not sure why the difference? Is it b/c of different libraries used?
Author
Owner

@tagur87 commented on GitHub (May 15, 2023):

Ahh, I actually see that django-strawberry issue got reopened....

@tagur87 commented on GitHub (May 15, 2023): Ahh, I actually see that django-strawberry issue got reopened....
Author
Owner

@jeremystretch commented on GitHub (May 15, 2023):

Yeah, the intent currently is to replace django-graphene with django-strawberry in v4.0, although work has not yet begun on that initiative.

@jeremystretch commented on GitHub (May 15, 2023): Yeah, the intent currently is to replace `django-graphene` with `django-strawberry` in v4.0, although work has not yet begun on that initiative.
Author
Owner

@jeremystretch commented on GitHub (Jun 23, 2023):

As this has already been raised and will likely be moot upon adopting django-strawberry, I'm going to close this out.

@jeremystretch commented on GitHub (Jun 23, 2023): As this has already been raised and will likely be moot upon adopting django-strawberry, I'm going to close this out.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8062