# mobx-graphlink

> Integrate data from a GraphQL backend into MobX and React with declarative path requests. (built on Apollo)

Latest version **0.1.17** (published 2026-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install mobx-graphlink
pnpm add mobx-graphlink
yarn add mobx-graphlink
bun add mobx-graphlink
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.17 |
| Published | 2026-09-11 |
| First published | 2021-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 489 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Venryx |
| Maintainers | venryx |
| Keywords | mobx, react, graphql, apollo, database, postgresql, postgres |

## Links

- npm: https://www.npmjs.com/package/mobx-graphlink
- Repository: https://github.com/Venryx/mobx-graphlink
- Homepage: https://github.com/Venryx/mobx-graphlink#readme
- Issues: https://github.com/Venryx/mobx-graphlink/issues
- npm.io page: https://npm.io/package/mobx-graphlink

## Dependencies (11)

- [ajv](https://npm.io/package/ajv.md) ^8.8.1
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [updeep](https://npm.io/package/updeep.md) ^1.2.0
- [chokidar](https://npm.io/package/chokidar.md) ^3.5.2
- [commander](https://npm.io/package/commander.md) ^8.0.0
- [tiny-glob](https://npm.io/package/tiny-glob.md) ^0.2.9
- [ajv-keywords](https://npm.io/package/ajv-keywords.md) ^5.0.0
- [js-vextensions](https://npm.io/package/js-vextensions.md) ^1.0.74
- [strip-comments](https://npm.io/package/strip-comments.md) ^2.0.1
- [@types/json-schema](https://npm.io/package/@types/json-schema.md) ^7.0.8

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.1.17 (latest) — 2026-09-11
- 0.1.16 — 2026-09-05
- 0.1.15 — 2026-08-29
- 0.1.14 — 2026-08-13
- 0.1.13 — 2026-08-12
- 0.1.12 — 2026-08-11
- 0.1.11 — 2026-08-11
- 0.1.10 — 2025-08-09
- 0.1.9 — 2025-08-06
- 0.1.8 — 2025-08-06
- 0.1.7 — 2025-08-06
- 0.1.6 — 2025-06-08
- 0.1.5 — 2025-04-16
- 0.1.4 — 2025-04-11
- 0.1.3 — 2025-04-11
- … 52 more at https://npm.io/package/mobx-graphlink/versions

## README

# MobX Graphlink

Integrate data from a GraphQL backend into MobX and React with declarative path requests. (built on Apollo)

### Installation

1) `npm install mobx-graphlink --save-exact`

The `--save-exact` flag is recommended (to disable version-extending), since this package uses [Explicit Versioning](https://medium.com/sapioit/why-having-3-numbers-in-the-version-name-is-bad-92fc1f6bc73c) (`Release.Breaking.FeatureOrFix`) rather than SemVer (`Breaking.Feature.Fix`).

For `FeatureOrFix` version-extending (recommended for libraries), prepend "`~`" in `package.json`. (for `Breaking`, prepend "`^`")

### Setup

1) TODO
2) Create classes and json-schemas for row/document types. Example:
```
@DBClass({table: "todoItems"})
export class TodoItem {
	@DB((t, n)=>t.text(n))
	@Field({type: "string"})
	id: string;

	@DB((t, n)=>t.text(n))
	@Field({type: "string"}, {req: true})
	text: string;

	@DB((t, n)=>t.boolean(n))
	@Field({type: "string"})
	completed: boolean;

	@DB((t, n)=>t.specificType(n, "text[]"))
	@Field({items: {type: "string"}})
	tags: string[];
}
```
3) Create class containing DB structure information. Example:
```
export class GraphDBShape {
	todoItems: Collection<TodoItem>;
}
```
4) Create Graphlink instance:
```
declare module "mobx-graphlink/Dist/UserTypes" {
	// if you're using an app-wide mobx data-store, that you want easily accessible within "accessor" funcs
	interface UT_StoreShape extends RootState {}
	
	// shares the GraphDBShape class above (along with its TS type-constraints) with the mobx-graphlink library
	interface UT_DBShape extends GraphDBShape {}
}

export const graph = new Graphlink<RootState, GraphDBShape>();
store.graphlink = graph;
SetDefaultGraphOptions({graph});

export function InitGraphlink() {
	graph.Initialize({rootStore: store});
}
```

### Usage

TODO

### Alternatives

TODO

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