Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL: timezone inconsistent with REST API #7466

Closed
arjenvri opened this issue Oct 6, 2021 · 9 comments
Closed

GraphQL: timezone inconsistent with REST API #7466

arjenvri opened this issue Oct 6, 2021 · 9 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@arjenvri
Copy link

arjenvri commented Oct 6, 2021

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.

@arjenvri arjenvri added the type: bug A confirmed report of unexpected behavior in the application label Oct 6, 2021
@jeremystretch jeremystretch added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Oct 7, 2021
@jeremystretch jeremystretch changed the title GraphQL timezone inconsistent with RESTAPI GraphQL timezone inconsistent with REST API Oct 13, 2021
@ryanmerolle
Copy link
Contributor

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
Copy link
Contributor

I found another:

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

In this case type is not matching the API.

@github-actions
Copy link
Contributor

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 github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Dec 15, 2021
@ryanmerolle
Copy link
Contributor

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

@ryanmerolle ryanmerolle removed the pending closure Requires immediate attention to avoid being closed for inactivity label Dec 15, 2021
@jeremystretch
Copy link
Member

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.

@ryanmerolle
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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 github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Feb 28, 2022
@ryanmerolle
Copy link
Contributor

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 ryanmerolle removed the pending closure Requires immediate attention to avoid being closed for inactivity label Mar 1, 2022
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Mar 24, 2022
@ryanmerolle ryanmerolle changed the title GraphQL timezone inconsistent with REST API GraphQL: timezone inconsistent with REST API Jun 22, 2022
@jeremystretch
Copy link
Member

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

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants