prisma / prisma-examples

🚀 Ready-to-run Prisma example projects
https://www.prisma.io/docs/
Apache License 2.0
6.1k stars 1.42k forks source link

Flutter client #111

Closed ghost closed 5 years ago

ghost commented 6 years ago

Would you consider supporting Dart CLient too ?

Dart Lib for graphql https://github.com/zino-app/graphql-flutter

Example https://github.com/zino-app/graphql-flutter/blob/master/example/lib/main.dart

I use this with a graphql Golang server based on GQLgen now and its nice and clean flow.

schickling commented 6 years ago

Thanks a lot for this great suggestion. Can you open a feature request for a Dart client in the prisma repo similar to this one?

ghost commented 5 years ago

hey @schickling Thanks for the opportunity to propose this. I find Flutter to be a huge time saver for Mobile and Desktop apps. Here is the Feature Proposal Issue: https://github.com/prisma/prisma/issues/3393

I suggested a few approaches also. The most relevent thing i feel is Subscriptions for sending updates to the client. Typically the Client will pull what it needs to and hold it in memory or DB over many request response cycles. If the Server knows what views your holding, then when a row relating to that view changes on the server it can send it out too the client(s).

I have not looked too deeply into the Subscriptions Architecture for Prisma yet. In the end, because Prisma is an ORM, your going to need to hold state for what subscriptions have been setup. I guess you could use a "exclusive schema" in the DB that no one else touches.

The other way is to use NATS streaming, which is durable and can be backed with postgresql or cockroachdb (mini hack required that the NATS team refuse to do - https://github.com/nats-io/nats-streaming-server/issues/614).

Lastly, there is also LIftbridge (https://github.com/liftbridge-io/liftbridge) which takes a more Kafka approach and pushes logs out to subscribers. The contradictions of each approach (and others) i cant really advice on.

Hasura (https://github.com/hasura/graphql-engine#realtime-applications) as i am sure you know are using DB triggers. This is not really going to cut it with Subscriptions. For example i have a query of a table and in the GUI its a Grid View Table i can sort any row, and i want updates to any of the rows via a Subscription. Materialised View might help in memory ( which is a bit like a DataLoader. CQRS separating the read write path would help this hugely but is a bridge too far for Prisma for now i suspect. But i have to say that Graphql and CQRS is very aligned , and would open the door for some large Choreography based system that are just not possible without a Prisma Proxy in the middle of it all.

Anyway, Happy to help in whatever way i can. I am based in Berlin and Prisma looks like a very well thought out and documented project. Hats off on the quality control.

nikolasburk commented 5 years ago

Thanks so much for your initiative and thinking about a Flutter client for Prisma! I'm closing this issue since it doesn't really relate to any examples but rather to the general feature set of Prisma, so the FR https://github.com/prisma/prisma/issues/3393 you created should be enough! 🙏

brokercl commented 4 years ago

Hi Nikolasburk I follow your tutorial

https://www.howtographql.com/react-apollo/1-getting-started/

and it was excellent but for now I would like to make the same but using flutter I tried to read users from prisma but until now without any succsees result

thats why I encourage to you to try develop the same but this time using Flutter from Google

I could do this toturial satisfactorily

https://medium.com/flutter-community/building-a-simple-application-with-flutter-and-graphql-5786764df102

greetings