New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

wechatmp-batch-graphql

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wechatmp-batch-graphql

Query Batching in Wechat Mini Program

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

wechatmp-batch-graphql

Query Batching in Wechat Mini Program

  • What is GraphQL?
  • Query batching in Apollo

Examples

import { BatchGraphql, gql } from 'wechatmp-batch-graphql'
const graphql = new BatchGraphql({
  uri: '/graphqls'
})

const query1 = gql`
query getProduct($id: ID!) {
  node(id: $id) {
    ... on Product {
      description
    }
  }
}
`
const query2 = gql`
query chineseRegions {
  chineseRegions {
    code
    name
  }
}
`
graphql.request(query1({
  id: 'Z2lkOi8vUFJPRFDVC9OSzAwMTQ='
}))

graphql.request(query2())

// query1 and query2 it will send in one request

Install

// use yarn
yarn add wechatmp-batch-graphql
// use npm
npm install wechatmp-batch-graphql

License

MIT

Thanks

Heavily inspired by nanographql

FAQs

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