Why we decided against GraphQL for local state management

序言和动机

这个怎么运作

查询getallMessages($ userId:id!){
用户(ID:$ userId){
姓名
profilePic
messages {
ID
通讯{
姓名
profilePic
}
开了@client
}
}
}
type ResolverFn = (
父母:任何,
args:任何,
{cache}:{cache:apollocache }
)=> any;
const defaultresolver = {
询问: {
用户:{
消息:{
开了: (parent, args, { cache }) => {
// reference the cache to get your data return
cache.readquery({
查询:消息_is_open_query,
变量:{
messageId:parent.id,
},,
});
},,
},,
},,
},,
};
//定义初始客户端状态
const defaultState = {
用户:{
消息:{
等法:false,
}
}
}
const client = new ApolloClient({
//其他Apollo配置,例如链接
//和缓存定义
resolvers: defaultResolver,
});
//用您的初始状态加油
client.writedata({
查询:消息_is_open_query,
数据:{defaultstate,},
});

The issues we encountered

开发人员的开销和学习曲线

新事物,借了什么?

Other options

Where do we net out?

188bet金宝搏官网OkCupid技术博客

阅读Okcupid工程团队的故事,每天连接数188bet金宝搏官网百万人

尼克·布兰特

Written by

软件工程师·NYC·https://nickbrandt.dev

188bet金宝搏官网OkCupid技术博客

OkCupid’s Engineering team is responsible for matching millions of people daily. Read their stories on the OkCupid tech blog

尼克·布兰特

Written by

软件工程师·NYC·https://nickbrandt.dev

188bet金宝搏官网OkCupid技术博客

OkCupid’s Engineering team is responsible for matching millions of people daily. Read their stories on the OkCupid tech blog