apollo server v4的Redis缓存

xriantvc  于 2023-10-15  发布在  Redis
关注(0)|答案(1)|浏览(99)

我有以下查询

query GetMajorIncidents {
            getMajorIncidents {
                category
                subcategory
                dv_cmdb_ci
                dv_state
                major_incident_state
                number
                opened_at
                short_description
                u_clientpriority
                u_global_priority
                u_clientpriority
                u_incident_end
                u_incident_start
                u_incident_commander
                dv_u_business_segments
                dv_u_communication_category
                duration {
                    days
                    hours
                    minutes
                    seconds
                    milliseconds
                }
            }
        }

我已经把缓存代码放在解析器中**(无法粘贴代码)**,info参数设置为

info.cacheControl.setCacheHint({
                        maxAge: 300,
                        scope: 'PUBLIC',
                    });

Redis中没有缓存。
现在,如果我从上面的查询中删除duration对象,它将开始缓存结果。我不知道为什么会这样

我的schema看起来像:

type Data {
category: String
                subcategory: String
                dv_cmdb_ci: String
                dv_state: String
                major_incident_state: String
                number: String
                opened_at: String
                short_description: String
                u_clientpriority: String
                u_global_priority: String
                u_clientpriority: String
                u_incident_end: String
                u_incident_start: String
                u_incident_commander: String
                dv_u_business_segments: String
                dv_u_communication_category: String
duration: Duration
}

type Duration {
days: Int
      hours: Float
      minutes: Float
      seconds: Float
      milliseconds: Float
}

有人能帮帮忙吗

qhhrdooz

qhhrdooz1#

已解决!我可以通过向持续时间架构提供该高速缓存参数来修复此问题

相关问题