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

typo #47

Open
nrbnlulu opened this issue Jan 19, 2023 · 2 comments
Open

typo #47

nrbnlulu opened this issue Jan 19, 2023 · 2 comments

Comments

@nrbnlulu
Copy link

Beast: The returned Mutation

AFAIK it was a query 🙃

@nrbnlulu
Copy link
Author

nrbnlulu commented Jan 19, 2023

BTW I am thinking to generate a more specific codegen lib for Qt and (more precisely Qt-QML) if you are interested on joining forces I would be happy (: qtgql/qtgql#12.

IMO your approuch with pydantic, even though it looks cosmetically nice, is a preformance killer, since you are doing codgen you can just create classes (possibly with __slots__)...

@jhnnsrs
Copy link
Owner

jhnnsrs commented Jan 19, 2023

Oh yes this should be fixed in the documentation generation, generally that features is still quite underdeveloped, will have a look there again, any further suggestions on how turms should handle that?

When it comes to performance, I am inclined to agree, and I initially was planning on just using pure dataclasses, however there is this little problem with interfaces and their (de)serialization especially if you want to use fragments. Given this json return

Given this query

fragment Apple on Apple{
   worm
}

fragment Banana on Banana {
  eaten
}

query Get_Fruits { 
   fruits {
        name
        ...Apple
        ...Banana
   }
}

And this return

{"fruits": [{"__typename": "Apple", "worm": true }, {"__typename": "Banana", "eaten": true}]}

You would have to generate your own deserialization logic that is able to map to the correct Fragment, which lead me to just ditch that approach and use pydantic (which supposedly will see a performance bump soon moving to rust based deserialization). Hope that clarifies the decision a bit better!

And yes I would love to work on that, was hoping to maybe find something more like useQuery, useMutation in the QT ecosystem. Just tell me where to start ;)

Btw, this is a turms related issue so i will move the discussion there!

@jhnnsrs jhnnsrs transferred this issue from jhnnsrs/rath Jan 19, 2023
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