This packages export GraphQLSchema
built with graphql-tools, which can be used to create a GraphQL service that queries Pokémon data from PokéAPI v2.
This library is still missing most of the API. Help us out by creating GraphQL Schema and resolvers based on PokéAPI v2 docs.
The convention is to preserve naming from their API, except -
in query name will be replaced with _
.
npm i pokemon-graphql-schema graphql
// ES Module
import { schema } from "pokemon-graphql-schema";
// CommonJS
const { schema } = require("pokemon-graphql-schema");
In node
, you must polyfill fetch
using node-fetch:
const fetch = require("node-fetch");
if (!globalThis.fetch) {
globalThis.fetch = fetch;
}
MIT. Do whatever your heart desires!