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

Query should add support for non-constant defaultValue #346

Closed
techouse opened this issue Jul 12, 2022 · 1 comment
Closed

Query should add support for non-constant defaultValue #346

techouse opened this issue Jul 12, 2022 · 1 comment
Assignees
Labels
documentation Documentation related

Comments

@techouse
Copy link
Collaborator

techouse commented Jul 12, 2022

I noticed that there was a discussion around this already in #21 and the proposed solution added a defaultValue option to Query.

class Query {
  final String name;
  final dynamic defaultValue;
  ...
}

I recently found myself in need in need of such a feature when defaulting to a value of a function call, e.g. DateTime.now(). toIso8601String().

Currently, there's no other way of doing this other than making the auto-generated method private and wrapping it in another method and supplying the dynamic data within that function's body, just like it's explained here.

@techouse techouse changed the title Query should support non-constant defaultValue Query should add support non-constant defaultValue Jul 12, 2022
@techouse techouse changed the title Query should add support non-constant defaultValue Query should add support for non-constant defaultValue Jul 12, 2022
@techouse
Copy link
Collaborator Author

Never mind, I figured I could just get by by using a @FactoryConverter(request: doSomethingToTheParams).

@techouse techouse self-assigned this Jan 8, 2023
@techouse techouse added the documentation Documentation related label Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related
Projects
None yet
Development

No branches or pull requests

1 participant