Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zmartbag.com/graphql-query

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zmartbag.com/graphql-query

## Installation

  • 0.4.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

GraphQL Query wrapper

Installation

npm i @zmartbag.com/graphql-query

Usage

import { GraphQLQuery } from '/path/to/@zmartbag.com/graphql-query/index.js';

const graphQLQuery = new GraphQLQuery({
	fetch, // Or import node-fetch if on server
	graphqlUrl: 'https://domain/graphql',
	log: {
		silly: (msg) => '', // console.log(msg),
		debug: (msg) => '', // console.log(msg),
		verbose: (msg) => console.log(msg),
		info: (msg) => console.info(msg),
		warn: (msg) => console.warn(msg),
		error: (msg) => console.error(msg),
	}
});

graphQLQuery.run({ query: 'query { foo { bar }}' }).then(result => {
	// result will be a js object from the JSON data obtained by the query
}).catch(err => {
	throw err;
});

Version history

  • 0.4.0 - ESM and CJS builds in parallel
  • 0.2.0 - Changed gatewayUrl to graphqlUrl
  • 0.1.4 - Seriously better error reporting
  • 0.1.3 - Fixed broken code in last release...
  • 0.1.2 - Better error reporting when non-JSON returns from GraphQL remote

FAQs

Package last updated on 24 Mar 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc