Skip to content

Commit 227dbea

Browse files
committed
disable schema for production
1 parent cfa9170 commit 227dbea

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ Change devise settins under `config/initializers/devise.rb` and `config/initiali
8686
### 4. GraphQL
8787
[graphql-ruby](https://github.com/rmosolgo/graphql-ruby) is a Ruby implementation of GraphQL. Sadly it's not 100% open source, but with the free version allows you amazing things to do. See the [Getting Started Guide](https://graphql-ruby.org/) and the current implementations in this project under `app/graphql/`.
8888

89+
#### Schema on production
90+
We have disabled introspection of graphQL entry points here `app/graphql/graphql_schema.rb`. Remove `disable_introspection_entry_points` if you want to make the schema public accessible.
91+
8992
### 5. CORS
9093
Protect your app and only allow specific domains to access your API. Set `CLIENT_URL=` in `.env` to your prefered client. If you need advanced options please change the CORS settings here `config/initializers/cors.rb`.
9194

app/graphql/graphql_schema.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Entry point for graphql schema
44
class GraphqlSchema < GraphQL::Schema
5+
disable_introspection_entry_points if Rails.env.production?
56
query(Types::QueryType)
67
mutation(Types::MutationType)
78
end

0 commit comments

Comments
 (0)