pokemon-graphql-schema

Exports of typeDefs and resolvers of PokéAPI GraphQL service to be used with graphql-tools

Usage no npm install needed!

<script type="module">
  import pokemonGraphqlSchema from 'https://cdn.skypack.dev/pokemon-graphql-schema';
</script>

README

pokemon-graphql-schema

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.

Development

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 _.

Installation

npm i pokemon-graphql-schema graphql

Usage

// ES Module
import { schema } from "pokemon-graphql-schema";
// CommonJS
const { schema } = require("pokemon-graphql-schema");

Fetch polyfill

In node, you must polyfill fetch using node-fetch:

const fetch = require("node-fetch");

if (!globalThis.fetch) {
    globalThis.fetch = fetch;
}

License

MIT. Do whatever your heart desires!