Last active
February 22, 2017 18:22
-
-
Save BjRo/8a018f4b89574e4cbb29c645c23cffeb to your computer and use it in GitHub Desktop.
Batching experiments with different server-side GraphQL implementations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fragment profileFragment on ProfileRef { | |
__typename | |
... on ActiveProfileRef { | |
id | |
firstName | |
lastName | |
} | |
... on InactiveProfileRef { | |
id | |
} | |
} | |
query profileRefQuery { | |
me { | |
profileRef { | |
... profileFragment | |
} | |
profileVisits { | |
collection { | |
visitorConnection { | |
... profileFragment | |
} | |
} | |
total | |
} | |
} | |
profileRefs(ids: [2,4,5]) { | |
... profileFragment | |
} | |
} |
The main reason that dataloader and absinthe differ here is presumably because me
is synchronous, so profileRef and profileRefs get resolved within the same tick. Can you clarify the details of which fields are actually making data requests vs resolving instantly? It's hard to conclude anything based on these numbers alone.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Behind
me/profileRef
,profileVisits/visitorConnection
andprofileRefs
are batched resolvers that point to the same REST API.profileVisits
points to another one.visitorConnection
together)