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 service returning Internal Server Error when calling subscription operation #3601

Closed
MohamedSabthar opened this issue Nov 3, 2022 · 1 comment · Fixed by ballerina-platform/module-ballerina-graphql#1034
Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Points/1.5 Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/PCM Protocol connector packages related issues Type/Bug
Milestone

Comments

@MohamedSabthar
Copy link
Member

MohamedSabthar commented Nov 3, 2022

Description:
Graphql service returning Internal Server Error when calling subscription operation. The error returned when http:Listener passed as an argument of graphql:Listener. Passing the port number instead of http:Listener works without any issue

Steps to reproduce:

import ballerina/graphql;
import ballerina/http;

public type Review record {|
  int score;
  string description;
|};

table<Review> reviews = table [
    {score: 20, description: "GOOD"},
    {score: 20, description: "BAD"}
];

service /reviews on new graphql:Listener(check new http:Listener(9090)) {
    resource function get latest() returns Review {
        return reviews.toArray().pop();
    }
    
   // this works fine for service /reviews on new graphql:Listener(9090)
    resource function subscribe live() returns stream<Review> {
        return reviews.toArray().toStream();
    }
}

Affected Versions:
2201.2.x

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

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.

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.5 Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/PCM Protocol connector packages related issues Type/Bug
Projects
Archived in project
3 participants