简体   繁体   中英

Graphql - how to omit tables from the auto-generated graphiql

Im working on postgraphile server. the stack is: nodejs, expressjs, postgraphile and knex.

My auto-generated graphiql exposes queries to tables it doesn't need to - knex_migrations .

following this doc: 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:

@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.

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. Using @omit create,update,delete only removes the autogenerated mutations -but does not remove read operations (usage in queries).

See docs for @omit for all available options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM