🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@coderich/autograph

Package Overview
Dependencies
Maintainers
1
Versions
313
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coderich/autograph

AutoGraph

0.0.7
Source
npm
Version published
Weekly downloads
757
477.86%
Maintainers
1
Weekly downloads
 
Created
Source

AutoGraph

A GraphQL resolver for unified data access.

:heavy_check_mark: MongoDB :heavy_check_mark: Neo4j

AutoGraph is a unified API to query and mutate data defined in a GraphQL Schema. It's a data resolver and business logic handler that can be used in and outside of a GraphQL server.

Features include:

  • Unified Query API
  • Cursor Pagination
  • Atomic Transactions
  • Memoized Caching (via DataLoader)

:fire: If you're looking to build a GraphQL Server API, check out AutoGraphServer!

Getting Started

First, install AutoGraph via NPM:

npm i @coderich/autograph --save

To get started, create a Resolver. Each Resolver provides a context to run queries for a given Schema.

const { Resolver } = require('@coderich/autograph');

const resolver = new Resolver(schema);

That's it! Now you're ready to use the resolver to query and mutate data.

Refer to the documentation below for how to define a schema.

Resolving Data

Each Resolver treats your schema definition as a graph of connected nodes. To begin a query or mutation, you must first identify a node in the graph as your starting point.

.match

Identify a node, returns a QueryBuilder.

const queryBuilder = resolver.match('Person');
.transaction

Identify a node, returns a Transaction.

const txn = resolver.transaction('Person');

Keywords

graphql

FAQs

Package last updated on 11 Feb 2020

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