zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 620 forks source link

feat(graphql_flutter): make first version of demo app #1204

Open vincenzopalazzo opened 2 years ago

vincenzopalazzo commented 2 years ago

Continuing to split https://github.com/zino-hofmann/graphql-flutter/pull/1190

Fixes https://github.com/zino-hofmann/graphql-flutter/issues/1162 Fixes https://github.com/zino-hofmann/graphql-flutter/issues/1155

The common mistake that I make also during this demo is how we declare the link for the subscription, and I think in this case the link offers a bad API.

BTW the correct way to declare the Link in order to work with Subscriptions is the following one

  final Link link = Link.split(
    (request) => request.isSubscription,
    wsLink,
    httpLink,
  );

Ah I was forgetting, this PR introduce also a new demo that work with the following API https://api.chat.graphql-flutter.dev based on the repository https://github.com/vincenzopalazzo/keep-safe-graphql that will be offer a lot of servers to provide integration testing server for graphql library

codecov[bot] commented 2 years ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 60.48%. Comparing base (425f648) to head (bc0b5f0). Report is 138 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1204 +/- ## ========================================== + Coverage 59.61% 60.48% +0.86% ========================================== Files 41 28 -13 Lines 1684 1435 -249 ========================================== - Hits 1004 868 -136 + Misses 680 567 -113 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vincenzopalazzo commented 2 years ago

Why are you deleting the tests? Also, are you sure that your example project structure actually works with pub.

Good catch the test are just a refused because I was trying to implement integration testing, and accidentally I removed the test dir, I will reintroduce it and also make the suggestion that you had!