by Sajeetharan |  @kokkisajee

Leverage POSTMAN 

TO BUILD EFFICIENT GRAPHQL APIS

Leverage POSTMAN 

TO BUILD EFFICIENT GRAPHQL APIS

Postman API DAY

In a nutshell

Communities

Social Developer

Recognitions

Product Manager @Microsoft

First GDE,MCT and MVP from SL

Top stackoverflow contributor

 

I'm Sajeetharan Sinnathurai

@sajeetharan
@kokkisajee
@sajeetharan
@sajeetharan

Agenda

👍An “Intermediate session"

 

👍It won’t teach you everything,  But it will help you learn what you need to know to get started

 

 

 

 

👍Be ready to  ask questions

 

👍Celebrate together!

Introduction to API, GraphQL concepts

Get our hands dirty

Let's start with a question

@kokkisajee

Internet of OLD

Server

1. Request

2. HTML

@kokkisajee

The new Era

Server

1. Request

2. HTML

Many more

@kokkisajee

State of APIS

@kokkisajee

Common problems with REST

Issue#1 Multiple round trips

Issue#2 Over-fetching of data

While requesting nested data, we often have to make several round trips or define an entirely newend point

Wouldn't it be nice if client receives only the data that it requires?

Issue#3 Absence of  Self-Documentation

The onus lies with the developer to document the API and allow exploration and discovery of your APIs.

@kokkisajee

GraphQL - a new way to interact with your data

@kokkisajee

GraphQL in a nuthshell

http://graphql.org/

@kokkisajee

GET /movies/1

{
  "title": "The Greatest Showman",
  "director": {
    "firstName": "Michael",
    "lastName": "Gracey"
  }
  // ... more fields
}

@kokkisajee

GET /movies/1

{
  "title": "The Greatest Showman",
  "directorId": 1
  // ... more fields
}


GET /directors/1

{
  "firstName": "Michael",
  "lastName": "Gracey"
  // ... more fields
}

@kokkisajee

GET /graphql?query={ movie(id: "1") { title, author { firstName } } }

{
  "title": "The Greatest Showman",
  "director": {
    "firstName": "Michael"
  }
}

@kokkisajee

In REST, the server is decides the structure of the data

In graphQL, the client does

@kokkisajee

Query

Mutation

Subscription

Basic concepts

@kokkisajee

@kokkisajee

query GET_MAIN_DATA {
  me {














  }
}
name
bio
avatarLg: avatar_url(size: 168)
avatarSm: avatar_url(size: 40)
socials {
  url
}
photos(limit: 3) {
  src
}
friends(limit: 3) {
  name
  avatar_url(size: 100)
}

Query : Example

@kokkisajee

@kokkisajee

mutation CREATE_POST($value: String!) {
 createPost(value: $value) {














 }
}
author {
  name
  avatar_url(size: 40)
}
body
id
date
...

Mutation : Example

@kokkisajee

@kokkisajee

subscription FEED_UPDATES {
 postAdded {










 }
}
author {
  name
  avatar_url(size: 40)
}
body
id
date
...

Query : Subscription

@kokkisajee

@kokkisajee

Characteristics of Good GraphQL API

Sufficiently Powerful

Hard to Misuse and easy to maintain

Appropriate to Audience and easy to expand

Easy to Learn and use even without documentation

@kokkisajee

Postman : The saviour since 2012

Recurring Operations

Environment Configuration (For performance testing)

Automated Graphql API tests

Test Data Generation

Exploratory API Testing

@kokkisajee

Here Comes the PostMan

@kokkisajee

An Analogy

@kokkisajee

POSTMAN fundamentals

@kokkisajee

Let's see it in action

@kokkisajee

I'm open to questions!

Q&A

@kokkisajee

"Always pass on what you have learned."

 

Thank you

@kokkisajee

Postman API day 2023

By Sajeetharan Sinnathurai

Postman API day 2023

Offline-first apps need to support: intermittent connectivity, transition seamlessly between online and offline states, reliable CRUD on-device data, data synchronisation and data conflict resolution to enable real-time collaboration. Amplify DataStore is an on device persistent repository for interacting with local data and able to automatically synchronize via GraphQL. Using Amplify DataStore will allow us to implement offline-first while using a simple programming model.

  • 555