0.3.0 • Published 3 years ago
@prequest/graphql v0.3.0
@prequest/graphql
A Syntax Sugar For Post Http Request Based On PreQuest.
Introduction
This is a part of PreQuest library which meaning you can't do anything with this single.
Install
npm install @prequest/graphql
Usage
import { PreQuest } from '@prequest/core'
const instance = PreQuest.create(adapter, {
path: '/graphql',
baseURL: 'http://localhost:3000',
})
const request = graphql(instance)
const query = `
{
me {
name
}
}
`
const variables = { name: 'prequest' }
const opt = { path: '/graphql' }
request(query, variables, opt).then(res => console.log(res))