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

When Enum has a Value Assigned, GraphQL Input does not pass the Correct Value #3721

Closed
ThisaruGuruge opened this issue Nov 28, 2022 · 2 comments · Fixed by ballerina-platform/module-ballerina-graphql#1195
Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Points/1 Reason/MultipleComponentInteraction Issue occured due to interactions in multiple components. Team/PCM Protocol connector packages related issues Type/Bug
Milestone

Comments

@ThisaruGuruge
Copy link
Member

ThisaruGuruge commented Nov 28, 2022

Description:
Consider the following code:

import ballerina/graphql;

service on new graphql:Listener(4000) {
    resource function get weekday(Weekday weekday) returns Weekday {
        return weekday;
    }
}

enum Weekday {
    # Uses the value 01
    SUNDAY = "Sunday",
    # Uses the value 02
    MONDAY = "Monday"
}

Use the following query:

{
    weekday(weekday: SUNDAY)
}

The following is the response:

{
  "data": {
    "weekday": "SUNDAY"
  }
}

But it should be the following:

{
  "data": {
    "weekday": "Sunday"
  }
}

When the resource method is executed, the weekday parameter value is the enum member name, not the value.

@ThisaruGuruge
Copy link
Member Author

Blocked on ballerina-platform/ballerina-lang#38846

@github-actions
Copy link

github-actions bot commented Feb 1, 2023

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@ThisaruGuruge ThisaruGuruge added Reason/MultipleComponentInteraction Issue occured due to interactions in multiple components. and removed Status/Blocked Issues that are currently blocked. labels Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/graphql Issues related to Ballerina GraphQL module Points/1 Reason/MultipleComponentInteraction Issue occured due to interactions in multiple components. Team/PCM Protocol connector packages related issues Type/Bug
Projects
Archived in project
1 participant