How to customize behaviour of generated services/methods? #5500
-
Hi all! I've got some issue to resolve and wonder if it is possible to clearly develop together with codegen. I use graphql-codegen typescript-apollo-angular generator in Angular8 project together with GraphQL API. In another word - it would be something like, when I call watch method from originally generated GQL service, I would like to call my function/method first and then from inside, call original one. Is there a way to customize services generated by generator? Or to add some decorator/extend base class? I know I can make my own service and pass those GeneratedServices to some methods every time I need to perform request (callback-solution), but it is not a clear solution and can provide a lot of problems. If my description is not clear I will extend it. Hope to hear something from you, 'cause I don't have another ideas... High5! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
At the moment, it's not possible to manipulate the generate service with the Apollo-Angular plugin. I can recommend you to either fork it and adjust it to your needs, or create a custom plugin that add the functionality you need. |
Beta Was this translation helpful? Give feedback.
At the moment, it's not possible to manipulate the generate service with the Apollo-Angular plugin. I can recommend you to either fork it and adjust it to your needs, or create a custom plugin that add the functionality you need.