1.3.0 • Published 2 years ago

@ruffpuff/celestia v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Ko-fi Donate Continuous Deployment npm

Table of Contents

The package that comes with this API uses GraphQL Code Generator for full typings of the API.

npm install @ruffpuff/celestia
yarn add @ruffpuff/celestia

Here is some example usage with the API, using the package @ruffpuff/celestia

import type { Query } from '@ruffpuff/celestia';

interface AnimalCrossingResponse<K extends keyof Omit<Query, '__typename'>> {
  data: Record<K, Omit<Query[K], '__typename'>>;
}

fetch('http://localhost:0617', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: `
      {
        getVillagerByName(villager: bob) {
          key
          keyJp
          art
          species
          catchphrase
        }
      }
    `
  })
})
  .then(res => res.json() as Promise<AnimalCrossingResponse<'getVillagerByName'>>)
  .then(json => console.log(json.data));
import type { Query } from '@ruffpuff/celestia';
import { fetch } from '@foxxie/fetch';

interface AnimalCrossingResponse<K extends keyof Omit<Query, '__typename'>> {
  data: Record<K, Omit<Query[K], '__typename'>>;
}

fetch('http://localhost:0617')
  .body({
    query: `
        {
          getVillagerByName(villager: bob) {
            key
            keyJp
            art
            species
            catchphrase
          }
        }
    `
   })
  .post()
  .json<AnimalCrossingResponse<'getVillagerByName'>>()
    .then(json => console.log(json.data));

Meta

Donating helps ensure that I can keep this project going. Thank you for supporting :D

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

1.3.0

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago