Pokémon API - API Reference -
-Welcome to the sample Pokémon API reference. This is a live example of how you can use - DociQL in conjunction with - GraphQL to generate beautiful static documentation for your own APIs.
-The Pokémon API is GraphQL API. It's schema can be fetched using introspection query and can be used for generating code, documentations, tests etc.
-GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
-API Endpoints
-Test Server:
-https://graphql-pokemon2.vercel.app
-
-
- Terms of Service: - https://graphql-pokemon2.vercel.app/terms -
-Contact: - dmiasoutov@wayfair.com -
-Version: - 1.0.0 -
-Fetching Pokémons
-Base methods to fetch pokemon information.
-- Fetch Pokémons -
-Query list of Pokémon
--
-
-
- first:
- integer- -
-
(no description)
-Example
- Request Content-Types:
- application/json
-
- Query
-
-
-
- query pokemons($first: Int!){
- pokemons(first: $first){
- id
- number
- name
- weight{
- minimum
- maximum
- }
- height{
- minimum
- maximum
- }
- classification
- types
- resistant
- weaknesses
- fleeRate
- maxCP
- maxHP
- image
- }
-}
-
-
-
- Variables
-
-
-
- {
- "first": "integer"
-}
-
-
-
- Try it now
-
query pokemons($first: Int!){
- pokemons(first: $first){
- id
- number
- name
- weight{
- minimum
- maximum
- }
- height{
- minimum
- maximum
- }
- classification
- types
- resistant
- weaknesses
- fleeRate
- maxCP
- maxHP
- image
- }
-}
-{
- "first": "integer"
-}
-Successful operation
-Response Content-Types: - application/json -
-Response Example - (200 OK) -
- - - -{
- "data": {
- "pokemons": [
- {
- "id": "string",
- "number": "string",
- "name": "string",
- "weight": {
- "minimum": "string",
- "maximum": "string"
- },
- "height": {
- "minimum": "string",
- "maximum": "string"
- },
- "classification": "string",
- "types": [
- "string"
- ],
- "resistant": [
- "string"
- ],
- "weaknesses": [
- "string"
- ],
- "fleeRate": "number",
- "maxCP": "integer",
- "maxHP": "integer",
- "image": "string"
- }
- ]
- }
-}
-
-
-
- - Fetch single Pokémon -
-Query any Pokémon by number or name
--
-
-
- id:
- string- -
-
-
- name:
- string- -
-
(no description)
-(no description)
-Example
- Request Content-Types:
- application/json
-
- Query
-
-
-
- query pokemon($id: String, $name: String){
- pokemon(id: $id, name: $name){
- id
- number
- name
- weight{
- minimum
- maximum
- }
- height{
- minimum
- maximum
- }
- classification
- types
- resistant
- weaknesses
- fleeRate
- maxCP
- maxHP
- image
- }
-}
-
-
-
- Variables
-
-
-
- {
- "id": "string",
- "name": "string"
-}
-
-
-
- Try it now
-
query pokemon($id: String, $name: String){
- pokemon(id: $id, name: $name){
- id
- number
- name
- weight{
- minimum
- maximum
- }
- height{
- minimum
- maximum
- }
- classification
- types
- resistant
- weaknesses
- fleeRate
- maxCP
- maxHP
- image
- }
-}
-{
- "id": "string",
- "name": "string"
-}
-Successful operation
-Response Content-Types: - application/json -
-Response Example - (200 OK) -
- - - -{
- "data": {
- "pokemon": {
- "id": "string",
- "number": "string",
- "name": "string",
- "weight": {
- "minimum": "string",
- "maximum": "string"
- },
- "height": {
- "minimum": "string",
- "maximum": "string"
- },
- "classification": "string",
- "types": [
- "string"
- ],
- "resistant": [
- "string"
- ],
- "weaknesses": [
- "string"
- ],
- "fleeRate": "number",
- "maxCP": "integer",
- "maxHP": "integer",
- "image": "string"
- }
- }
-}
-
-
-
- Evolution & Attacks
-Custom methods to fetch pokemon
-- Query Attack Rating -
-Query Pokémon
--
-
-
- id:
- string- -
-
-
- name:
- string- -
-
(no description)
-(no description)
-Example
- Request Content-Types:
- application/json
-
- Query
-
-
-
- query pokemon($id: String, $name: String){
- pokemon(id: $id, name: $name){
- id
- name
- attacks{
- fast{
- name
- type
- damage
- }
- special{
- name
- type
- damage
- }
- }
- }
-}
-
-
-
- Variables
-
-
-
- {
- "id": "string",
- "name": "string"
-}
-
-
-
- Try it now
-
query pokemon($id: String, $name: String){
- pokemon(id: $id, name: $name){
- id
- name
- attacks{
- fast{
- name
- type
- damage
- }
- special{
- name
- type
- damage
- }
- }
- }
-}
-{
- "id": "string",
- "name": "string"
-}
-Successful operation
-Response Content-Types: - application/json -
-Response Example - (200 OK) -
- - - -{
- "data": {
- "pokemon": {
- "id": "string",
- "name": "string",
- "attacks": {
- "fast": [
- {
- "name": "string",
- "type": "string",
- "damage": "integer"
- }
- ],
- "special": [
- {
- "name": "string",
- "type": "string",
- "damage": "integer"
- }
- ]
- }
- }
- }
-}
-
-
-
- - Query Evolutions -
-Query Pokémon evolutions
--
-
-
- id:
- string- -
-
-
- name:
- string- -
-
(no description)
-(no description)
-Example
- Request Content-Types:
- application/json
-
- Query
-
-
-
- query pokemon($id: String, $name: String){
- pokemon(id: $id, name: $name){
- id
- name
- evolutions{
- id
- number
- name
- classification
- types
- resistant
- weaknesses
- fleeRate
- maxCP
- evolutions{
- ...RecursivePokemonFragment
- }
- maxHP
- image
- }
- }
-}
-
-
-
- Variables
-
-
-
- {
- "id": "string",
- "name": "string"
-}
-
-
-
- Try it now
-
query pokemon($id: String, $name: String){
- pokemon(id: $id, name: $name){
- id
- name
- evolutions{
- id
- number
- name
- classification
- types
- resistant
- weaknesses
- fleeRate
- maxCP
- evolutions{
- ...RecursivePokemonFragment
- }
- maxHP
- image
- }
- }
-}
-{
- "id": "string",
- "name": "string"
-}
-Successful operation
-Response Content-Types: - application/json -
-Response Example - (200 OK) -
- - - -{
- "data": {
- "pokemon": {
- "id": "string",
- "name": "string",
- "evolutions": [
- {
- "id": "string",
- "number": "string",
- "name": "string",
- "classification": "string",
- "types": [
- "string"
- ],
- "resistant": [
- "string"
- ],
- "weaknesses": [
- "string"
- ],
- "fleeRate": "number",
- "maxCP": "integer",
- "maxHP": "integer",
- "image": "string"
- }
- ]
- }
- }
-}
-
-
-
- Schema Definitions
-- Pokemon: object - -
-Represents a Pokémon
--
-
-
- id:
- object- - -
-
-
-
The ID of an object
-
- -
- number:
- string- -
-
-
-
The identifier of this Pokémon
-
- -
- name:
- string- -
-
-
-
The name of this Pokémon
-
- -
- weight:
- -- -- PokemonDimension --
-
-
-
The minimum and maximum weight of this Pokémon
-
- -
- height:
- -- -- PokemonDimension --
-
-
-
The minimum and maximum weight of this Pokémon
-
- -
- classification:
- string- -
-
-
-
The classification of this Pokémon
-
- -
- types:
- string[]- -
-
-
-
The type(s) of this Pokémon
-
- -
- resistant:
- string[]- -
-
-
-
The type(s) of Pokémons that this Pokémon is resistant to
-
- -
- attacks:
- -- -- PokemonAttack --
-
-
-
The attacks of this Pokémon
-
- -
- weaknesses:
- string[]- -
-
-
-
The type(s) of Pokémons that this Pokémon weak to
-
- -
- fleeRate:
- number- -
-
-
- maxCP:
- number- -
-
-
-
The maximum CP of this Pokémon
-
- -
- evolutions:
- -- -- Pokemon --
-
-
-
The evolutions of this Pokémon
-
- -
- evolutionRequirements:
- - -- -
-
-
-
The evolution requirements of this Pokémon
-
- -
- maxHP:
- number- -
-
-
-
The maximum HP of this Pokémon
-
- -
- image:
- string- -
-
Example
- - - -{
- "number": "string",
- "name": "string",
- "weight": {
- "minimum": "string",
- "maximum": "string"
- },
- "height": {
- "minimum": "string",
- "maximum": "string"
- },
- "classification": "string",
- "types": [
- "string"
- ],
- "resistant": [
- "string"
- ],
- "attacks": {
- "fast": [
- {
- "name": "string",
- "type": "string",
- "damage": "number"
- }
- ],
- "special": [
- {
- "name": "string",
- "type": "string",
- "damage": "number"
- }
- ]
- },
- "weaknesses": [
- "string"
- ],
- "fleeRate": "number",
- "maxCP": "number",
- "evolutions": [
- {
- "number": "string",
- "name": "string",
- "weight": {
- "minimum": "string",
- "maximum": "string"
- },
- "height": {
- "minimum": "string",
- "maximum": "string"
- },
- "classification": "string",
- "types": [
- "string"
- ],
- "resistant": [
- "string"
- ],
- "attacks": {
- "fast": [
- {
- "name": "string",
- "type": "string",
- "damage": "number"
- }
- ],
- "special": [
- {
- "name": "string",
- "type": "string",
- "damage": "number"
- }
- ]
- },
- "weaknesses": [
- "string"
- ],
- "fleeRate": "number",
- "maxCP": "number",
- "evolutions": [
- {
- "number": "string",
- "name": "string",
- "weight": {
- "minimum": "string",
- "maximum": "string"
- },
- "height": {
- "minimum": "string",
- "maximum": "string"
- },
- "classification": "string",
- "types": [
- "string"
- ],
- "resistant": [
- "string"
- ],
- "attacks": {
- "fast": [
- {
- "name": "string",
- "type": "string",
- "damage": "number"
- }
- ],
- "special": [
- null
- ]
- }
- }
- ]
- }
- ]
-}
-
-
-
- - PokemonDimension: object - -
-Represents a Pokémon's dimensions
--
-
-
- minimum:
- string- -
-
-
-
The minimum value of this dimension
-
- -
- maximum:
- string- -
-
-
-
The maximum value of this dimension
-
-
Example
- - - -{
- "minimum": "string",
- "maximum": "string"
-}
-
-
-
- - PokemonAttack: object - -
-Represents a Pokémon's attack types
-Example
- - - -{
- "fast": [
- {
- "name": "string",
- "type": "string",
- "damage": "number"
- }
- ],
- "special": [
- {
- "name": "string",
- "type": "string",
- "damage": "number"
- }
- ]
-}
-
-
-
- - Attack: object - -
-Represents a Pokémon's attack types
--
-
-
- name:
- string- -
-
-
-
The name of this Pokémon attack
-
- -
- type:
- string- -
-
-
-
The type of this Pokémon attack
-
- -
- damage:
- number- -
-
-
-
The damage of this Pokémon attack
-
-
Example
- - - -{
- "name": "string",
- "type": "string",
- "damage": "number"
-}
-
-
-
- - PokemonEvolutionRequirement: object - -
-Represents a Pokémon's requirement to evolve
--
-
-
- amount:
- number- -
-
-
-
The amount of candy to evolve
-
- -
- name:
- string- -
-
-
-
The name of the candy to evolve
-
-
Example
- - - -{
- "amount": "number",
- "name": "string"
-}
-
-
-
-