下面是我的代码片段。在 python 3.7 中运行代码时出现错误SyntaxError: f-string: expressions nested too deeply
。我应该如何重构我的代码?
GRAPH_QL_FIELDS = """
cubeId
title
deleted
timeVariableFormat
statisticalProgram {
name
}
topics{
topicId
}
}
"""
query_topics = (
f'query cubesWithTopicLink($deleted: Boolean!, $topicId: String, $first: Int, $skip: Int) {{'
f'dataCubes(where:{AND:[{topics_some: {{topicId: $topicId}}}, {deleted: $deleted}]}, first: $first, skip: $skip) {{'
f'{GRAPH_QL_FIELDS}'
f'dataCubesConnection(where: {topics_some: {topicId: $topicId}})'
f'{{aggregate{{count}}}}'
f'}}'
)