java - 如何在 GraphQL Java 上拆分模式

我正在为网站新闻开发 API GraphQL。但是我遇到了一个问题,我拥有一个具有多个突变、查询和类型的模式。我想将架构拆分为多个特定于其类型的架构。

这可能吗?

最佳答案

const countryType = `
type Country {
  _id: ID!
  name: String!
  region: [Region!]!
}
`

const regionType = `
type Region {
  _id: ID!
  name: String!
  countries: [Country!]
}
`

const schema = `
${countryType}
${regionType}

# ... more stuff ...
`

module.exports = buildSchema(schema);

https://stackoverflow.com/questions/49825745/

相关文章:

php - NelmioApiDocBundle 不生成文档

google-chrome - Chrome 不尊重主机文件条目

azure - 在不属于 Active Directory 的 Azure VM 上创建新用户

angular - 如何将 Blob 转换为图像并将其显示 Angular 5

sql - Oracle left join 表现得像 inner join

python - 在 spark-submit 之前安装 pyspark 作业的要求

angular - 新的 Angular HTTPClient 从 Dreamfactory API

protocol-buffers - 运行 protoc 时是否可以指定输出版本?

azure - Azure 应用服务重新启动时会发生什么?

git - 从 GitLab merge 请求中排除特定提交