![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
lokka-transport-graphql-js
Advanced tools
Local Schema Transport Layer for Lokka
This is a transport layer for wrapping Lokka around your graphql-js schema without going over the network.
Install the package:
npm i --save lokka-transport-graphql-js
npm i --save lokka
This is how to send request to Facebook's SWAPI GraphQL Demo.
import GraphqlJSTransport from 'lokka-transport-graphql-js';
import schema from './path/to/my-schema'; // A valid instance of GraphQLSchema
const transport = new GraphqlJSTransport(schema);
transport.send(`
{
allFilms {
films {
title
}
}
}
`).then(response => {
console.log(JSON.stringify(response, null, 2));
});
It's possible to send rootValue and context:
const transport = new GraphqlJSTransport(schema, { rootValue: myRootValue, context: myContext });
By default it will create and throw a new Error
object using the first GraphQL error. Error handling can be customized with the handleErrors
option. Check the default error handler in lib/index.js
for an example.
v1.0.0
7 November 2016
FAQs
Local Schema Transport for Lokka
The npm package lokka-transport-graphql-js receives a total of 486 weekly downloads. As such, lokka-transport-graphql-js popularity was classified as not popular.
We found that lokka-transport-graphql-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.