TopTaal
(language course planning and finance)
Ministry of Defence
(vehicle maintenance app)
Ruler
(compliance control SaaS)
GET /api/dashboard?
courseData=true&
lastEnrolled=true&
duePayments=true&
filter=mobile&
randomundocumentedparam[0]=surewhatever
GET /v1/dashboard/default/Loadtasks?mode=&day=&pageload=true
<div class="dossier_item " data-index="3" dossierid="2770" data-requesthash="3ec0e17ca850b9e9b59869921939daaf"> <div class="clear"></div> <div id="dossierview" class="allmywrf" divtype="dossierview"> <div class="dossier_left" > <input type="hidden" value="1" name="allowscrollallmywrf" id="allowscrollallmywrf" /><div class="dossier_item " data-index="0" dossierid="2176" data-requesthash="3c2f07c3743095676393a862c8ed903a"> <div class="avatar_wrapper" style="width:130px;min-width:130px;"> <div style="font-size:1.2em;"><span style="color:rgba(232, 75, 61, 1);white-space:nowrap;"><span class="icon-alarmclock" style="margin-right:10px;"></span>12-08-2019</span></div></div> <div class="dossier_item_content"> <div class="dossier_item_description"> <div class="dossier_title">
POST /api/v1/somerandomrpccall/pleasedontsuemefornotadheringtorestspec
POST /api/v1/user/
POST /api/v2/user/sureillkeepthoseworking
POST /api/v3/user/pleasedontmakeme-remaplegacyfields-again
POST /api/v4/user/yeahsureilldoitagain
oh wow, there is even an animation showing off versioning
var query = `query _($searchText: String) { courseMaterials(searchText: $searchText) { _id name } }`;
fetch(β/api/graphql', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', },
body: JSON.stringify({ query, variables: { searchText }, }) }) .then(r => r.json()) .then(data => console.log('data returned:', data));
import gql from "graphql-tag"; import { Query } from "react-apollo"; const GET_COURSEMATERIALS_QUERY = gql` query _($searchText: String) { courseMaterials (searchText: $searchText) { _id name } } `
const CourseMaterialsContainerComponent = () => ( <Query query={GET_COURSEMATERIALS_QUERY}>
{({ loading, error, data }) => { if (error) return <Error /> if (loading) return <Loading />; return <CourseMaterialList coursematerials={data.coursematerials} /> }} </Query> )
fetchMore()
- superclean pagination APIprefetching
- already retrieve next data on hoverInMemoryNormalizedCache
- Zero-config cachingoptimisticResponse
- simulate the results of a mutationsubscriptions
- push data from the server to the clientsan API standard for websocket-style communication
https://medium.com/@tfarguts/websockets-for-beginners-part-2-9a1970a1c228subscription onCommentAdded($repoFullName: String!){ commentAdded(repoFullName: $repoFullName){ id content } }
{ "data": { "commentAdded": { "id": "123", "content": "Hello!" } } }
const COMMENTS_SUBSCRIPTION = gql` subscription onCommentAdded($repoFullName: String!) { commentAdded(repoFullName: $repoFullName) { id content } } `;
function DontReadTheComments({ repoFullName }) { const { data: { commentAdded }, loading } = useSubscription( COMMENTS_SUBSCRIPTION, { variables: { repoFullName } } ); return <h4>New comment: {!loading && commentAdded.content}</h4>; }
integrating both direct database and legacy REST calls
Legacy Python app with GraphQL layer replicating legacy pages
@peterpeerdeman
peter@lifely.nl