Javascript 阿波罗:道具/缓存不';在REFETCH查询中更新

Javascript 阿波罗:道具/缓存不';在REFETCH查询中更新,javascript,reactjs,graphql,react-apollo,Javascript,Reactjs,Graphql,React Apollo,我正在使用阿波罗的HoCs来实现我目前的变异,但我对我得到的一些错误感到困惑: 这是我的疑问: 从“graphql标签”导入gql; 从“../../fragments/careProvider”导入{careTeamMember}; const getFullMemberDetails=gql` 查询getFullMemberDetails($id:id!){ 成员(id:$id){ 身份证件 创建于 出生日期 名字 姓 名称 电子邮件 电话 已证实的 知情同意 // .... } } ${

我正在使用阿波罗的HoCs来实现我目前的变异,但我对我得到的一些错误感到困惑:

这是我的疑问:


从“graphql标签”导入gql;
从“../../fragments/careProvider”导入{careTeamMember};
const getFullMemberDetails=gql`
查询getFullMemberDetails($id:id!){
成员(id:$id){
身份证件
创建于
出生日期
名字
姓
名称
电子邮件
电话
已证实的
知情同意
// ....
}
}
${careTeamMember}`;
导出默认getFullMemberDetails;
这些是我的突变:

从“graphql标签”导入gql;
const updateMember=gql`
变异UpdateMember($input:UpdateMemberInput!){
updateMember(输入:$input){
成功
成员{
身份证件
名称
名字
姓
电子邮件
电话
出生日期
知情同意
hipaa_隐私政策
检查频率天数
}
}
}
`;
导出默认updateMember;
从“graphql标签”导入gql;
const updateMemberInsurancePolicy=gql`
突变更新记忆铀政策(
$member\u id:id!,
$carrier\u name:String,
$insurance\u member\u id:String,
$insurance\u group\u id:String,
$plan\u名称:字符串,
) {
更新成员保险政策(
成员id:$成员id,
承运商名称:$承运商名称,
保险会员id:$保险会员id,
保险组id:$保险组id,
计划名称:$计划名称,
) {
会员保险单{
身份证件
承运人名称
保险集团
保险会员身份证
计划名称
成员{
身份证件
预见{
身份证件
你能安排一下吗
}
}
}
成功
}
}
`;
导出默认updateMemberInsurancePolicy;
像这样被使用

handleMemberSubmit=async(formData):Promise=>{
试一试{
常数有效载荷={
id:this.props.data.member.id,
补丁:{
first_name:formData.first_name,
姓氏:formData.last_name,
出生日期:formData.date出生日期,
电话:formData.phone,
// ....
付款偏好:formData.payment\u preference?“自费”:“保险”,
},
};
常数保险有效载荷={
成员id:this.props.data.member.id,
承运人名称:formData.insurance\u policy.carrier\u name,
计划名称:formData.insurance\u policy.plan\u name,
保险组id:formData.insurance\u policy.insurance\u group\u id,
保险成员id:formData.insurance\u policy.insurance\u member\u id,
};
常数[
更新成员响应,
亚微量反应,
]等待承诺([
此.props.updateMember(有效负载),
这是道具次保险(insurancePayload),
]);
常量{data:{updateMember}}=updateMemberResponse;
const{data:{updateMemberInsurancePolicy}}=submitInsuranceResponse;
返回此.props.addNotification('Member updated!','success');
}捕捉(错误){
返回此.props.addNotification(getFirstError(err),'error');
}
}
以及特别组织

graphql(getFullMemberDetails{
选项:(ownProps):对象=>({
id:ownProps.id,
}),
}),
graphql(更新成员{
props:({mutate}):{updateMember:(输入:对象)=>Promise}=>({
updateMember:(输入):Promise=>mutate({
变量:{input},
选项:(道具):对象=>({
参考查询:[{
查询:getFullMemberDetails,
变量:{id:props.id},
}],
}),
}),
}),
}),
graphql(更新成员保险{
支柱:({mutate}):{次保险:()=>{}=>({
次保险:(输入):承诺=>mutate({
变量:{…输入},
}),
}),
}),
此异步方法工作正常,但在这两个查询完成后,
getFullMemberDetails
查询不会运行

但是,当我将
refetchQueries
移动到HoC中的
options
之外时,如下所示:

graphql(更新成员{
props:({mutate,ownProps}):{updateMember:(输入:Object)=>Promise}=>({
updateMember:(输入):Promise=>mutate({
变量:{input},
参考查询:[{
查询:getFullMemberDetails,
变量:{id:ownProps.id},
}],
}),
}),
}),
my
getFullMemberDetails
确实运行,但我遇到如下错误:

 {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getFullMemberDetails"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"member"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"created_at"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"date_of_birth"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"first_name"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"last_name"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"name"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"email"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"phone"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"verified"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"informed_consent"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"postal_address"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"street_address_1"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"street_address_2"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"city"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"state"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"zip_code"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"country"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"time_zone"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"calendar"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cohort"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"name"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"customer"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"name"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"basic_visits_covered"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"specialist_visits_covered"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"dependents_allowed"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"contract_term"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_at"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"end_at"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"in_person_supported"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"care_team"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"care_navigator"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Frabundle.esm.js:63)
    at bundle.esm.js:1246
    at bundle.esm.js:1558
    at Set.forEach (<anonymous>)
    at bundle.esm.js:1556
    at Map.forEach (<anonymous>)
    at QueryManager.push.../../../node_modules/apollo-client/bundle.esm.js.QueryManager.broadcastQueries (bundle.esm.js:1554)
    at bundle.esm.js:1160
{“种类”:“文档”,“定义”:[{“种类”:“操作定义”,“操作”:“查询”,“名称”:{“种类”:“名称”,“值”:“getFullMemberDetails”},“变量定义”:[{“种类”:“变量定义”,“变量”:{“种类”:“变量”,“名称”:{“种类”:“名称”,“值”:“id”},“类型”:{“种类”:“非空类型”,“类型”:{“种类”:“名称”,“名称”:“种类”:“名称”,“值”:“ID”}}}],“指令”:[],“选择集”:{