Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Any way to prevent generated classes from extending JsonSerializable? #405

Open
MarkOSullivan94 opened this issue Nov 16, 2022 · 3 comments

Comments

@MarkOSullivan94
Copy link

Every class generated which extends JsonSerializable has all of the fields generated which you can see in the screenshot.

Is there any way to disable this behaviour?

Also curious if there is a good reason why I would want my class to extend JsonSerializable?

Screenshot 2022-11-17 at 00 12 55

@vasilich6107
Copy link
Collaborator

Hi @MarkOSullivan94

could you clarify why do you care what is inside generated code?)

@vasilich6107
Copy link
Collaborator

I do not remember why do we need extends JsonSerializable
maybe due to the client
https://github.com/comigor/artemis/blob/master/lib/client.dart

@MarkOSullivan94
Copy link
Author

MarkOSullivan94 commented Nov 19, 2022

could you clarify why do you care what is inside generated code?

All of these fields are publicly exposed for no good reason, I don't want to see them when my IDE shows which field / method I can use when working with a generated GraphQL model instance 😄

maybe due to the client
https://github.com/comigor/artemis/blob/master/lib/client.dart

I'm not sure the abstract class GraphQLQuery needs to extend JsonSerializable? 🤔

Though please correct me if I'm wrong, I didn't spend a lot of time looking into it and checking if it did or not 🤷

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants