2016-09-19 108 views
0

因此,我正在编写一个充当GraphQL服务器的nod​​e.js应用程序。我有一个这样的模式:如何使用GraphQL将嵌套对象作为参数传递给突变?

type Program { 
    _id: ID! 
    name: String! 
    cover: String! 
    groups: [Group] 
} 

type Group { 
    name: String! 
    exercises: [Exercise] 
} 

type Exercise { 
    _id: ID! 
    name: String! 
    tags: [String] 
    cover: String! 
    images: [String] 
    text: String! 
} 

,我需要建立一个Program,其中包括一些group S(group存储在Program内的一个文件中,这就是为什么)。

如何将嵌套对象作为参数传递给突变,以便它将创建嵌套对象?

回答

相关问题