New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mobx-graphlink

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobx-graphlink

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

latest
Source
npmnpm
Version
0.1.10
Version published
Maintainers
1
Created
Source

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

Installation

  • npm install mobx-graphlink --save-exact

The --save-exact flag is recommended (to disable version-extending), since this package uses Explicit Versioning (Release.Breaking.FeatureOrFix) rather than SemVer (Breaking.Feature.Fix).

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

Setup

  • TODO
  • 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[];
}
  • Create class containing DB structure information. Example:
export class GraphDBShape {
	todoItems: Collection<TodoItem>;
}
  • 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

Keywords

mobx

FAQs

Package last updated on 09 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts