react-express-graphql
v1.0.3
Published
![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/br
Downloads
5
Maintainers
Readme
Browser Support
| | | | | | --- | --- | --- | --- | --- | --- | 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);