Nestjs GraphQl不一致的Autoschemafile和服务SQL
我正在将Nestjs与ApollofeDerationDriver一起使用。我还添加了一些带有变换选项的前缀。问题是,在SDL中,我看不到那个前缀,但是在他的自动化学中。这是一个问题,因为我无法在此微服务和网关之间创建连接。
@Module({
imports: [
GraphQLModule.forRoot<ApolloDriverConfig>({
autoSchemaFile: 'src/graphql/schema.gql',
driver: ApolloFederationDriver,
plugins: [
ApolloServerPluginLandingPageLocalDefault(),
ApolloServerPluginInlineTraceDisabled(),
],
sortSchema: true,
transformSchema: <some_transforms>,
transformAutoSchemaFile: true,
}),
],
})
来自schema.gql文件的示例
type Query {
prefix_getSomeData(filter: prefix_FilterInput)
}
和SDL( Query apollogetservicedefinition {_service {sdl}} )中的同一查询
type Query {
getSomeData(filter: FilterInput)
}
。
I'm using nestJS with ApolloFederationDriver. I also add some prefix with transformSchema option. The issue is that in sdl I can't see that prefix, but in the autoSchemaFile he is. It is a problem, because I can't create connection between this microservice and Gateway.
@Module({
imports: [
GraphQLModule.forRoot<ApolloDriverConfig>({
autoSchemaFile: 'src/graphql/schema.gql',
driver: ApolloFederationDriver,
plugins: [
ApolloServerPluginLandingPageLocalDefault(),
ApolloServerPluginInlineTraceDisabled(),
],
sortSchema: true,
transformSchema: <some_transforms>,
transformAutoSchemaFile: true,
}),
],
})
Example from the schema.gql file
type Query {
prefix_getSomeData(filter: prefix_FilterInput)
}
And the same query in the sdl(query ApolloGetServiceDefinition { _service { sdl } })
type Query {
getSomeData(filter: FilterInput)
}
How I can add prefix to the sdl file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论