Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 649 Bytes

README.md

File metadata and controls

22 lines (13 loc) · 649 Bytes

gql-now

A simple nodejs/browser client to hit graphql apis

Install

npm install --save gql-now

Usage

import {GQLNow} from "gql-now";

let obj = new GQLNow("https://some.graphql.api/api/path",{'http_header1':'header_value1'});

// Query operation
let respnse = await obj.query("operation_name",{ field1:"value1" , field2:"value2", field3:4},"response_field response_field_neseted{ nested_field1 nested_field2 }");

// Mutation operation
let response_mutation = await obj.mutation("operation_name",{ field1:"value1" , field2:"value2", field3:4},"response_field response_field_neseted{ nested_field1 nested_field2 }");