Skip to content

Instantly share code, notes, and snippets.

@claritee
Last active August 3, 2019 23:00
Show Gist options
  • Save claritee/2c4aaab2a8fa5051240bc54d212f833d to your computer and use it in GitHub Desktop.
Save claritee/2c4aaab2a8fa5051240bc54d212f833d to your computer and use it in GitHub Desktop.
GraphQL Notes

Online Graphiql

Downloadable

Tutorials

Cheatsheet

Datasources

N + 1 and Dataloader

Caching

Graph Theory and Pagination

Example query (twitter api)

query queryUser {
  twitter {
   	tweet(id: "123") {
      id
      user {
        id
        name
        description
      }
      retweets(limit: 5) {
        id
        user {
          id
        }
      }
    }
  }
}

Example query - pokemon

{
  pokemon(name: "Pikachu") {
    id
    number
    name
    attacks {
      special {
        name
        type
        damage
      }
    }
    evolutions {
      id
      number
      name
      weight {
        minimum
        maximum
      }
      attacks {
        fast {
          name
          type
          damage
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment