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

graphql-request-helper

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-request-helper - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

1

lib/index.d.ts
export * from './graphql-client';
export * from './models';

@@ -14,2 +14,3 @@ "use strict";

__exportStar(require("./graphql-client"), exports);
__exportStar(require("./models"), exports);
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "graphql-request-helper",
"version": "0.1.7",
"version": "0.1.8",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

# graphql-request-helper
Helper Class of Graphql Client
## Getting Started
Installing
```bash

@@ -11,28 +14,33 @@ $ npm install graphql-request-helper

## Example
```js
import { GraphQLClient } from 'graphql-request-helper'
import { GraphQLClient } from "graphql-request-helper";
```
Create Graphql Client
```js
const graphQLClient = new GraphQLClient('http://localhost:3000/api/graphql')
const graphQLClient = new GraphQLClient("http://localhost:3000/api/graphql");
```
Performing a `Query` request
```js
const data = await graphQLClient.query({
queryName: 'getItems',
fields: [
'id',
{
name: 'shop',
fields: ['name']
}
],
params: {
page: 1
}
})
queryName: "getItems",
fields: [
"id",
{
name: "shop",
fields: ["id", "name"],
},
],
params: {
page: 1,
},
});
```
GraphQLClient receives the above fields and params and sends the following request
```js

@@ -44,2 +52,3 @@ query{

id
name
}

@@ -51,2 +60,3 @@ }

Performing a `Mutation` request
```js

@@ -57,4 +67,5 @@ // In ready.

Catch an Error
```js
// In ready.
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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