Query
Response
Supergraph
subgraph
subgraph
subgraph
query {
cat(name:"Biscuit") {
name
location
mood
}
}
{
"data": {
"cat": {
"name":"Biscuit",
"location": "Tahoe City",
"mood": "pensive"
}
}
}
POST /graphql
Query
mutation {
setLiftStatus(
name:"Panorama",
newStatus: "hold"
) {
name
newStatus
oldStatus
}
}
{
"data": {
"setLiftStatus": {
"name": "Panorama",
"newStatus": "hold",
"oldStatus": "open"
}
}
}
POST /graphql
Mutation
subscription {
liftStatusChange {
name
newStatus
oldStatus
}
}
{
"data": {
"setLiftStatus": {
"name": "Panorama",
"newStatus": "hold",
"oldStatus": "open"
}
}
}
WebSockets
Subscription
{
"data": {
"setLiftStatus": {
"name": "Astra Express",
"newStatus": "closed",
"oldStatus": "open"
}
}
}
{
"data": {
"setLiftStatus": {
"name": "Panorama",
"newStatus": "closed",
"oldStatus": "open"
}
}
}
query {
cat(name: "Biscuit") {
name
location
birthLocation
weight
gpa
astrologicalSign
hangingInThere
bicyclePreference
isADentist
knowsADentist
siblings {
name
location
}
}
}
do all of this
query {
cat(name: "Biscuit") {
name
location
birthLocation
weight
gpa
astrologicalSign
hangingInThere
bicyclePreference
isADentist
knowsADentist
siblings {
name
location
}
}
}
query {
cat(name: "Biscuit") {
name
location
birthLocation
}
}
query {
cat(name: "Biscuit") {
name
location
birthLocation
weight
...ExtraneousCatDetails @defer
}
}
fragment ExtraneousCatDetails on Cat {
gpa
astrologicalSign
hangingInThere
bicyclePreference
isADentist
knowsADentist
}
query {
cat(name: "Biscuit") {
name
friends {
name
}
}
}
query {
cat(name: "Biscuit") {
name
friends @stream(initialCount: 3) {
name
}
}
}
query {
cat(name: "Biscuit") {
name
friends @stream(initialCount: 3) {
name
...ExtraneousCatFields @defer
}
}
}
In @apollo/client@latest