Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owanesh/breakingbad_graphqlapi
GraphQL APIs about BreakingBad
https://github.com/owanesh/breakingbad_graphqlapi
api breaking-bad graphql strawberry
Last synced: 3 months ago
JSON representation
GraphQL APIs about BreakingBad
- Host: GitHub
- URL: https://github.com/owanesh/breakingbad_graphqlapi
- Owner: Owanesh
- Created: 2020-08-13T18:37:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-25T09:30:32.000Z (12 months ago)
- Last Synced: 2024-05-02T01:01:57.854Z (8 months ago)
- Topics: api, breaking-bad, graphql, strawberry
- Language: Python
- Homepage:
- Size: 119 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BreakingBad API *in GraphQL*
**Preface** | This repo has only purpose to make experiments with GraphQL by [Strawberry](https://github.com/strawberry-graphql/strawberry).
Dataset is retrieved from [BreakingBad Api](https://github.com/timbiles/Breaking-Bad--API).### Install dependencies
poetry install### Start the server
```sh
cd breakingbad/
poetry run strawberry server breakingbad
```### Play with payloads!
#### Basic query
Retrieve all characters
```js
{
characters {
items {
name
nickname
occupation
}
}
}
```
All episodes with extra information on characters
```js
{
episodes {
items {
title
season
series
characters {
name
nickname
}
}
}
}
```
#### Filtering
```js
{
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` ]
```js
{
deaths(after:2,first:4) {
next
items{
deathId
cause
death
lastWords
responsible
}
}
}
```