[英]Graphql - how to omit tables from the auto-generated graphiql
Im working on postgraphile server.我在 postgraphile 服务器上工作。 the stack is: nodejs, expressjs, postgraphile and knex.
堆栈是:nodejs、expressjs、postgraphile 和 knex。
My auto-generated graphiql exposes queries to tables it doesn't need to - knex_migrations
.我自动生成的 graphiql 将查询公开到它不需要的表 -
knex_migrations
。
following this doc: https://medium.com/make-it-heady/graphql-omit-table-from-generating-under-graphiql-postgres-smart-comments-6d3b6abec37遵循此文档: https://medium.com/make-it-heady/graphql-omit-table-from-generating-under-graphiql-postgres-smart-comments-6d3b6abec37
in the pgAdmin, I added in the properties of the knex_migrations
table the followings:在 pgAdmin 中,我在
knex_migrations
表的属性中添加了以下内容:
@name knex_migrations
@omit create,update,delete
This is the documentation.
still when running the server and opening graphiql, I see queries for the migrations table.仍然在运行服务器并打开 graphiql 时,我看到了对迁移表的查询。
what am I missing我错过了什么
If you want to completely omit the table completely from your graphql schema using a smart comment, you simply need to use the @omit
tag without any following actions.如果您想使用智能注释从您的 graphql 模式中完全省略该表,您只需使用
@omit
标记,无需任何后续操作。 Using @omit create,update,delete
only removes the autogenerated mutations -but does not remove read operations (usage in queries).使用
@omit create,update,delete
仅删除自动生成的突变 - 但不会删除读取操作(在查询中使用)。
See docs for @omit
for all available options.有关所有可用选项,请参阅
@omit
的文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.