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

@amoutonbrady/graphql-client

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amoutonbrady/graphql-client - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

7

dist/esm/graphql-client.js
// src/graphql-client.ts
function GraphQLClient(url, options = { fetch: fetch.bind(window), auth: "" }) {
let authorization = options.auth;
function GraphQLClient(url, options) {
let authorization = options.auth || "";
let headers = {};
const fetchFunc = options.fetch || fetch;
const setHeaders = (newHeaders, override = false) => {

@@ -10,3 +11,3 @@ headers = override ? newHeaders : { ...headers, ...newHeaders };

const request = (query, variables) => {
return options.fetch(url, {
return fetchFunc(url, {
method: "POST",

@@ -13,0 +14,0 @@ body: JSON.stringify({ query, variables }),

@@ -21,3 +21,3 @@ import type nodeFetch from 'node-fetch';

*/
export declare function GraphQLClient(url: string, options?: Options): {
export declare function GraphQLClient(url: string, options: Options): {
request: <T = any>(query: string, variables?: Record<string, any>) => Promise<T>;

@@ -24,0 +24,0 @@ setAuth: (token: string) => string;

{
"version": "0.3.0",
"version": "0.3.1",
"name": "@amoutonbrady/graphql-client",

@@ -4,0 +4,0 @@ "description": "Minimalistic GraphQL client",

@@ -0,0 +0,0 @@ <img alt="preview badge" src="https://img.shields.io/bundlephobia/min/@amoutonbrady/graphql-client">

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