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

Map QueryResult to dart model object #265

Closed
jaumard opened this issue May 7, 2019 · 2 comments
Closed

Map QueryResult to dart model object #265

jaumard opened this issue May 7, 2019 · 2 comments

Comments

@jaumard
Copy link

jaumard commented May 7, 2019

Is your feature request related to a problem? Please describe.
Would be nice to be able to use models instead of just Map, because in big payload it become really messy ^^

Describe the solution you'd like
having some code generation "fromMap" would be nice, we can then use client.query<MyQueryResultMapped>(...) that will internally call fromMap

Describe alternatives you've considered
Don't see any other

It will make usage of this lib even move convenient :)

@jaumard
Copy link
Author

jaumard commented May 8, 2019

Another solution would be to generate the model automatically from the query :) but might be hard to define field type.

Or yet another solutions is to let us make the model:

@query(forViewer:true)
class ReadRepository {
 ....
}

@micimize
Copy link
Collaborator

This is planned eventually and tracked in #26, but for now you can check out graphql-to-dart and the TypedQuery usage in the example.

Still pretty janky though, and I don't have much time to work on it.

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

No branches or pull requests

2 participants