我正在使用graphql java实现,有什么方法可以将在Java服务器端构造的架构带到浏览器客户端。
在很多情况下,我需要在客户端js中使用模式。
我听说其中一些使用插值查询在客户端构建模式,如果可以的话,谁能解释如何使用插值查询构建模式?
您需要从graphql-js调用两个函数
getIntrospectionQuery
生成需要发送到服务器的查询:https://github.com/graphql/graphql-js/blob/master/src/utilities/introspectionQuery.js#L18
buildClientSchema
您需要调用查询结果:https://github.com/graphql/graphql-js/blob/master/src/utilities/buildClientSchema.js#L80