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_generator2 does not provide a helpful error message when there is no default constructor #13

Open
Bennik2000 opened this issue Feb 28, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Bennik2000
Copy link
Contributor

When a @graphQLClass annotated class does not have a default constructor the generator throws an exception.

Example class:

@graphQLClass
class ItemGQO {
  String publicId = "";
  String name = "";

  //ItemPrintingGroupGQO();

  ItemPrintingGroupGQO.fromModel(Item model)
      : publicId = model.publicId,
        name = model.name;
}

The generated error message:

[SEVERE] graphql_generator2:graphql on lib/src/network/model/item_gqo.dart:

Null check operator used on a null value

Expected behavior:

  • As the generated code does not depend on the constructor the code can be generated
  • A helpful error message which tells the user to add the constructor
@dukefirehawk dukefirehawk added the enhancement New feature or request label Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants