Created GraphQL Schema and query root
This commit is contained in:
3
app/graph/consul_schema.rb
Normal file
3
app/graph/consul_schema.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
ConsulSchema = GraphQL::Schema.define do
|
||||
query QueryRoot
|
||||
end
|
||||
5
app/graph/types/query_root.rb
Normal file
5
app/graph/types/query_root.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
QueryRoot = GraphQL::ObjectType.define do
|
||||
name "Query"
|
||||
description "The query root for this schema"
|
||||
|
||||
end
|
||||
@@ -45,6 +45,8 @@ module Consul
|
||||
config.autoload_paths << "#{Rails.root}/app/models/custom"
|
||||
config.paths['app/views'].unshift(Rails.root.join('app', 'views', 'custom'))
|
||||
|
||||
# Add GraphQL directories to the autoload path
|
||||
config.autoload_paths << Rails.root.join('app', 'graph', 'types')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user