react-express-graphql

1.0.3 • Public • Published

Browser Support

Chrome Firefox Safari Opera Edge IE
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔ 11 ✔

Installing

Package manager

Using npm:

$ npm install react-express-graphql

Once the package is installed, you can import the library using import approach:

import {query , mutation} from "react-express-graphql"

Example for Query

import { query } from "react-express-graphql"

// Define the query

 let querystring=`
    category() {
        _id  
      }
    `
// Make a request for a query 
let baseurl="http://localhost:7002/graphql"

// Store the response
const response = await query(baseurl, querystring);

Example for Mutation

import { mutation } from "react-express-graphql"

// Define the mutation

let mutationstring= `
    createCategory(categoryInput: $CategoryInput) {
        _id
        email,         
    }
    `
// Make a request for a query 
let baseurl="http://localhost:7002/graphql"
const response = await mutation(baseurl, mutationstring);

License

MIT

Package Sidebar

Install

npm i react-express-graphql

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

8.9 kB

Total Files

10

Last publish

Collaborators

  • shivasatapathy