# firestore-graph-hooks

> Firebase client-side-join library like Graph QL

Latest version **1.0.0-alpha.5** (published 2022-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install firestore-graph-hooks
pnpm add firestore-graph-hooks
yarn add firestore-graph-hooks
bun add firestore-graph-hooks
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.5 |
| Published | 2022-07-02 |
| First published | 2022-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 3 |
| Unpacked size | 207.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ishowta |
| Maintainers | ishowta |

## Links

- npm: https://www.npmjs.com/package/firestore-graph-hooks
- Repository: https://github.com/ishowta/firestore-join-hooks
- Homepage: https://github.com/ishowta/firestore-join-hooks#readme
- Issues: https://github.com/ishowta/firestore-join-hooks/issues
- npm.io page: https://npm.io/package/firestore-graph-hooks

## Dependencies (3)

- [loglevel](https://npm.io/package/loglevel.md) ^1.8.0
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [loglevel-plugin-prefix](https://npm.io/package/loglevel-plugin-prefix.md) ^0.8.4

## Recent versions

- 1.0.0-alpha.5 (latest) — 2022-07-02
- 1.0.0-alpha.4 — 2022-02-15
- 1.0.0-alpha.3 — 2022-02-15
- 1.0.0-alpha.2 — 2022-02-13
- 1.0.0-alpha.1 — 2022-02-13

## README

# Firestore graph hooks

Firebase client-side-join library like Graph QL

```tsx
export const App = () => {
  const [projects, loading, error] = useQuery(getProjects(), (project) => ({
    ownerRef: {
      nowPlayingRef: {},
    },
    kanbans: field(getKanbans(project.ref), (kanban) => ({
      todoLists: field(getTodoLists(kanban.ref), {}),
    })),
  }));

  return (
    <div>
        {projects.map(project => (
            <div key={project.id}>
                <p>{project.data.owner.data?.name}</p>
                <p>{project.data.owner.data?.nowPlaying.data?.title}</p>
                <p>{project.data.kanbans.length}</p>
            </div>
        ))}
    </div>
  );
};
```

## TODO

- fix bug
  - result do not update on loading
  - should loading variable turn to true when onSnapshot
  - do not use path as key
- add tests
- nested document data
- error handling
- more strict types
- snapshot option
- fragment query
- flat query result structure mode
- no restriction reference field name mode
- documentation
- add guaranteed to exist option to ref field like extension field
- performance
  - keep unchanged field
- support class(withConverter)?
- internal typing strictly
  - subquery k/v type

---
_Source: https://npm.io/package/firestore-graph-hooks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
