firegraph 0.1.0 copy "firegraph: ^0.1.0" to clipboard
firegraph: ^0.1.0 copied to clipboard

outdated

Firegraph is a plugin that lets you query firestore with GraphQL.

Firegraph #

Firegraph is a plugin that lets you query firestore with GraphQL.

Getting Started #

Its very simple to get started. Just Install and use!

Installing #

To get the package from pub, run following command in your project directory

flutter pub get firegraph 

You can also include the package directly into pubspec.yaml file as

dependencies:
    firegraph: ^0.1.0

Usage #

To use firegraph, one must import the following into their file

import 'package:firegraph/firegraph.dart'

Querying Collections #

A collection can be queried same as a graphQL type query. For example, to query the collection posts with id and message fields for each document, the instruction would be:

Map posts = await Firegraph.resolve(FirebaseFirestore.instance, r'''
query{
    posts{
        id
        body
    }
}
''');

Querying Subcollections #

A subcollection can be treated as same as a type inside a parent type. For example, to query the subcollection comments inside document in the collection posts (the hierarchy is posts/doc/comments/doc) the instruction would be:

Map posts = await Firegraph.resolve(FirebaseFirestore.instance, r'''
query{
    posts{
        id
        body
        comments{
            id
            message
        }
    }
}
''');

This way you can query subcollections as deep as possible.

Contributing #

Thank you for your interest! You are welcome (and encouraged) to submit Issues and Pull Requests. You are welcome to ping me on Twitter as well: @taosif7

13
likes
0
points
27
downloads

Publisher

verified publishertaosif7.com

Weekly Downloads

Firegraph is a plugin that lets you query firestore with GraphQL.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cloud_firestore, flutter, graphql_parser

More

Packages that depend on firegraph