-
Notifications
You must be signed in to change notification settings - Fork 66
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
Generate GraphQL schema for local service variable declaration #3317
Generate GraphQL schema for local service variable declaration #3317
Comments
The graphql schema is generated in compile time and attached as a field of @graphql:ServiceConfig annotation of the graphql service object/declaration. This is done by the graphql compiler plugin by following two steps In the Second task, the node modification is performed by traversing the ModulePartNode (of the document) in a top-down manner. If the service node collected in the Map (from step 1) is found during the traversal then the node is modified with the annotation and the parent nodes are recursively modified until it reaches the ModulePartNode. The schema generation for module-level service variable declaration and service declaration already implemented using the mentioned approach. But it’s not efficient to implement the local service variable declaration as we need to consider a lot of local scopes (function definition, if else body, object field, etc...). @MaryamZi @hasithaa @warunalakshitha is there a simpler compiler plugin API to achieve this ? |
@MohamedSabthar Could you point me to the implementation of SyntaxNodeAnaylysisTask and SourceModiferTask. One way to achieve this is you could listen to object contractor events and add those to the map. Then later annotate it with graphql:ServiceConfig using SourceModiferTask. |
@hasithaa these are the implementation SyntaxNodeAnaylysisTask, SourceModifierTask |
Had a chat with @hasithaa @azinneera @ThisaruGuruge and @DimuthuMadushan on this issue. |
Blocked on #38054 |
@MohamedSabthar Shall we try to implement this with current design as we discussed during the call. Main problem with current design is not scalable when we have multiple code modifiers/modifications. |
Since there is low ROI, involves complex logic, and there's no urgency of this feature, the implementation of this functionality put on hold |
Description:
The current implementation of graphql module generate schema for both service declaration and module level (graphql:Service) variable declaration. But it not yet generates graphql schema for local variable declaration.
ex: bellow code doesn't generate a schema
Ideally graphql module should generate schema for local variable declaration in any block scope (function definition, if else body, object field, and so on)
Describe your problem(s)
Describe your solution(s)
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered: