简体   繁体   English

Graphql - 如何从自动生成的 graphiql 中省略表格

[英]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.

相关问题 如何在PreparedStatement中使用自动生成的@Id? - How to use auto-generated @Id in PreparedStatement? PostgreSQL:从 COPY FROM 插入返回自动生成的 ID - PostgreSQL: Return auto-generated ids from COPY FROM insertion 更改自动生成的序列 - Alter auto-generated sequence 如何在同一行发布中使用自动生成的主键 - How to use the auto-generated primary key in the same row postrges 从 postGres 触发器自动生成主键时尝试 saveAndFlush 提交 (JPA) 时出现问题 - Problem when attempting a saveAndFlush commit (JPA ) when primary key is auto-generated from postGres trigger 从 spring 3 / PostgreSQL 8.4.9 中的行插入获取自动生成的密钥 - Getting auto-generated key from row insertion in spring 3 / PostgreSQL 8.4.9 在PostGres中插入NULL值后,如何自动生成ID? - How do I get my IDs auto-generated when a NULL value is inserted in PostGres? 使用Play Framework Anorm,如何获取插入的自动生成的ID? - Using Play Framework Anorm, how do I get the auto-generated id back for an insert? slick 3自动生成 - 默认值(timestamp)列,如何定义Rep [Date]功能 - slick 3 auto-generated - default value (timestamp) column, how to define a Rep[Date] function 如何确定自动生成的主键用作另一个表的外键 - How to determine the auto-generated primary key used as a foreign key for another table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM