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 Schema Generation Fails when Import Statement is not Present in the FIle #4379

Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/PCM Protocol connector packages related issues Type/Bug
Milestone

Comments

@ThisaruGuruge
Copy link
Member

Description:

Consider a Ballerina package with the following files:

.
├── Ballerina.toml
├── service.bal
├── listener.bal

In the listener.bal file, the following listener is defined:

import ballerina/graphql;

listener graphql:Listener gqlListener = new (9090);

In the service.bal file, the following service is defined:

service on gqlListener {
    resource function get greeting() returns string {
        return "Hello, World";
    }
}

This throws the following compilation error:

ERROR [service.bal:(1:1,1:14320)] undefined annotation 'ServiceConfig'
ERROR [service.bal:(1:1,1:14320)] undefined module 'graphql'
error: compilation contains errors

This is because the code modifier does not add missing import statements in the service file. This should be handled in the code modifier.

@github-actions
Copy link

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 the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Apr 25, 2023
@ThisaruGuruge ThisaruGuruge added this to the 2201.6.0 milestone May 23, 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 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
1 participant