Fireship.io has some really good videos on this:
I highly recommend his Flutter course, as it makes things very easy:
Now as far as DGraph, it is the same premise as any Framework. You need to pass the token in the header to the graphql endpoint. You cannot use urql on Flutter (as it is a Typescript library), but there is an Apollo package in Flutter for this:
- GitHub - 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://pub.dev/documentation/flutter_graphql/latest/
And you just grab the token using the firebase getIdToken()
, like in any package. I will be updating my Firebase article in the next few days to reference some new things I have learned since 21.03.X
.
J