0.0.0 • Published 1 year ago

@genql/pokeapi v0.0.0

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

pokeapi.co TypeScript API client

GraphQL client for pokeapi.co with full TypeScript support

Installation

npm install @genql/pokeapi

Docs

You can read more about usage in the client docs and Genql docs

Example usage

import { createClient } from '@genql/pokeapi'
const client = createClient()


// query variables
let distinct_on
let limit = 3

client
  .query({
    pokemon_v2_ability: {
      __args: {
        distinct_on: distinct_on,
        limit: limit,
      },
      generation_id: true,
      id: true,
      is_main_series: true,
    },
  })
  .then((x) => console.log(JSON.stringify(x, null, 4)))



// query variables
let columns
let distinct = false
let distinct_on
let limit = 3

client
  .query({
    pokemon_v2_ability_aggregate: {
      __args: {
        distinct_on: distinct_on,
        limit: limit,
      },
      aggregate: {
        count: {
          __args: {
            columns: columns,
            distinct: distinct,
          },
        },
      },
      nodes: {
        generation_id: true,
        id: true,
        is_main_series: true,
      },
    },
  })
  .then((x) => console.log(JSON.stringify(x, null, 4)))

Sponsor

This project is sponsored by Notaku: Create public docs websites from your Notion pages

Notaku