My GraphQL learning points

GraphQL is an open-source data query and manipulation language for APIs, and a runtime for fulfilling queries with existing data.GraphQL was developed internally by Facebook in 2012 before being publicly released in 2015.
https://graphql.org/

GraphQL is a query language for an API, and a server-side runtime for executing queries by using a type system we define for our data. GraphQL isn't tied to any specific database or storage engine and is instead backed by our existing code and data.
Once a GraphQL service is running (typically at a URL on a web service), it can receive GraphQL queries to validate and execute. A received query is first checked to ensure it only refers to the types and fields defined, then runs the provided functions to produce a result.


GraphQL Request:
{
  me {
    name
  }
}
GraphQL Response:
{
  "me": {
    "name": "Ravi Kumar Pisupati"
  }
}

REST Vs GraphQL:
1) In REST, the endpoint you call is the identity of that object. In GraphQL, the identity is separate from how you fetch it.
2) In REST, the shape and size of the resource is determined by the server. In GraphQL, the server declares what resources are available, and the client asks for what it needs at the time.


Sample GraphQL request(FB) call from Command Line:

curl -i -X GET \ "https://graph.facebook.com/v6.0/me?fields=id,email,first_name,gender,hometown,friends&access_token=token info"

For more details, please google it.


















References:
1) Google.com
2) Wikipedia.org
3)  Graphql.org

Popular posts from this blog

Connecting Claude to Pega Infinity 25.1.3 via MCP — Step-by-Step

itextpdf API to generate PDF doc from an image file using Pega PE

Understanding of Hugging Face platform for AI/ML platform