Skip to content

frankeyey/graphql-apollo-learn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building APIs With GraphQL in Node.js Application

This repo is just for learning purpose, it is a clone from AppSignal blog. The blog guides on building a GraphQL API using Node.js and PostgresQL.

For more information, please refer to the original blog post.

Token in HTTP Header

{
  "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NSwibG9naW4iOiJhcHBzaWduYWwiLCJpYXQiOjE1ODk5MTYyNTAsImV4cCI6MTU4OTkxNjQzMH0.bGDmyi3fmEaGf3FNuVBGY7ReqbK-LjD2GmhYCc8Ydts"
}

Query brand

query($brand: String!) {
    beers(brand: $brand) [
        id
        name
        brand
        price
    ]
}

Fragment

query getBeers($id1: Int!, $id2: Int!) {
  beer1: beer(id: $id1) {
    ...beerFields
  }
  beer2: beer(id: $id2) {
    ...beerFields
  }
}

fragment beerFields on Beer {
  id
  name
  brand
  price
}

Query Variables

{
  "id1": 1,
  "id2": 3
}

About

Material for learning GraphQL Apollo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published