设置查询GraphQL的动态模式名​​称

时间:2019-09-25 11:46:22

标签: graphql

我有一个很大的json对象,如下所示:

serviceCatalog: {
    "clientId": [
        {
            ...some nested object...
        }
        {
            ...some nested object...
        }
    ],
    "clientId": [
        {
            ...some nested object...
        }
        {
            ...some nested object...
        }
    ]
}

为此创建graphQL模式时,我具有以下内容:

serviceCatalog.graphql(用于从MongoDB映射整个json文档结构):

type serviceCatalog { 
    serviceCatalog: { institutionServiceCatalog }
}

institutionServiceCatalog.graphql(用于带来特定的客户目录):

type institutionServiceCatalog {
    catalog:[institutionServiceCatalogItem]
}

institutionServiceCatalogItem.graphql(用于带来特定的目录项):

type institutionServiceCatalogItem {
    ...large set of properties...
}

从查询角度来看,我如何指定stitutionalServiceCatalog中的字段目录实际上是字符串类型的动态参数?

0 个答案:

没有答案