Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.

Owanesh/breakingbad_graphqlapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BreakingBad API in GraphQL

Preface | This repo has only purpose to make experiments with GraphQL by Strawberry. Dataset is retrieved from BreakingBad Api.

Install dependencies

poetry install

Start the server

cd breakingbad/
poetry run strawberry server breakingbad

Play with payloads!

Basic query

Retrieve all characters

{
  characters {
    items {
      name
      nickname
      occupation
    }
  }
}

All episodes with extra information on characters

{
  episodes {
    items {
      title
      season
      series
      characters {
        name
        nickname
      }
    }
  }
}

Filtering

{
  deaths(responsible:{nickname: "Heisenberg"}) {
    items{
      death
      cause
    }
  }
}

Pagination

Preface | Pagination technique used is "Cursor Pagination" to obtain more performance and readability than Connection type skipping edge nodes

  • after indicates the offset of query. [ after must be >= 0 ]
  • first indicate the number of results after after element do you want [ after must be set if you use first ]
{
  deaths(after:2,first:4) {
    next
    items{
      deathId
      cause
      death
      lastWords
      responsible
    }
  }
}

About

GraphQL APIs about BreakingBad

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages