Note
Looking for graphql-request
? It's been renamed to Graffle and the old version is available on the graphql-request
branch.
Simple, type-safe GraphQL client for JavaScript.
Documentation • Getting Started • Examples
npm install graffle@next graphql
import { Graffle } from 'graffle'
const graffle = Graffle
.create()
.transport({ url: 'https://countries.trevorblades.com/graphql' })
const data = graffle.gql(`
query getCountries {
countries {
name
capital
emoji
currency
}
}
query getContinents {
continents {
name
code
}
}
query getLanguage {
language(code: "en") {
name
native
}
}
`)
.getCountries()
Visit graffle.js.org for full documentation, guides, and examples.
MIT