我是 Graphql-Java 的新手,我正在尝试将两个 *.graphqls 文件作为数组加载到模式中。每个模式都定义了单独的查询。服务器启动后,我只看到最后一个文件中的查询被公开。我的代码如下。
A.graphqls
type Query{
queryOne(param : Param) : ResponseOne
queryTwo(param : Param) : ResponseTwo
}
B.graphqls
type Query{
queryThree(param : Param, param1 : Param1) : ResponseThree
}
我看到只有“queryThree”被暴露了。
我正在加载如下。
String[] graphlList = new String[]
{"graphqls/A.graphqls","graphqls/B.graphqls"};
GraphQLSchema gSchema = null;
SchemaParser schemaFile = SchemaParser.newParser()
.files(graphlList)
.resolvers(
all resolvers go here
).dictionary(
all Directory go here
).scalars(
all userdefined scalar defined here.
).build();
gSchema = schemaFile.makeExecutableSchema();
return gSchema;
请强调,我在哪里做错了。