Skip to content

alex-martinez-jativa/graphql-api-dog-breeds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRAPHQL DOG BREEDS API

Public API with information about dog breeds

https://graphql-api-dog-breeds.herokuapp.com/

Endpoint

/graphql

Query example

query{
  retrieveDogById(id:"5eaff43af96b5978ca726dd3"){
    id
    breedName
    description
    image
    dogInfo{
      height
      weight
      life
      breedGroup
    }
  }
}

Response example

{
  "data": {
    "retrieveDogById": {
      "id": "5eaff43af96b5978ca726dd3",
      "breedName": "neapolitan mastiff",
      "description": "The Neapolitan Mastiff dog breed was developed in southern Italy as a family and guard dog. Today this massive breed is known as a gentle giant.",
      "image": "https://cdn1-www.dogtime.com/assets/uploads/2011/01/file_22936_neapolitan-mastiff-300x189.jpg",
      "dogInfo": {
        "height": "24 to 31 inches tall at the shoulder",
        "weight": "120 to 200 pounds",
        "life": "8 to 10 years",
        "breedGroup": "working dogs"
      }
    }
  }
}

Schema

const typeDefs = `
    type Query {
        retrieveDogs: [Dog]!
        retrieveDogById(id: ID!) : Dog!
        retrieveByBreedGroup(breedGroup: String!) : [Dog!]!
        retrieveByQuery(query: String!) : [Dog!]! 
    }

    type Dog {
        id: ID!
        breedName: String!
        image: String!
        description: String!
        dogInfo: DogInfo
    }

    type DogInfo {
        height: String
        weight: String
        life: String
        breedGroup: String
    }`

if you want to try the REST service, go here:

https://github.com/alex-martinez-jativa/api-dog-breeds

Author

Alex Martínez Játiva

About

graphql API about dog breeds

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors