Socket
Book a DemoInstallSign in
Socket

express-graphlite

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-graphlite

Graphlite Express middleware

1.2.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Express Graphlite

Graphlite middleware for express.

Installation

yarn add express-graphlite

Usage

// ...
const app = express();

const schemas = require('../config/schemas');
const queries = require('../config/queries');
const associations = require('../config/useAssociations');
const databases = require('../config/databases');

// Create an instance of databases to run the query.
const storage = new SqliteStorage({ databases });

// Apply the middleware passing down all graphlite options.
app.use('/graphlite', expressGraphlite({
  schemas,
  queries,
  associations,
  connection: storage,
  debug: true,
}));

Options

NameTypeDescription
schemasArrayArray of Graphlite schemas
queriesArrayArray of Graphlite queries
associationsFunctionFunction to associated all schemas between them
connectionObject, FunctionObject or function which Graphlite uses to run the query on database.
debugBooleanIf must or must not enable the Graphlite builtin debugger.

After that, simply call the express server using the GET and the /graphlite/(findAll|findOne)/queryName url format.

The query options must be defined as json object and requested as application/json.

See Graphlite options reference for further information about specific filters keywords.

FAQs

Package last updated on 16 Aug 2019

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.