summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-12-21 17:23:09 -0700
committermo khan <mo.khan@gmail.com>2020-12-21 17:23:09 -0700
commitbcc2ad30081dbb78983c1545c188cefa20486a04 (patch)
tree309f243ed5daa85ad415c2df3a70359ca74c9261 /lib
parent143465ae64450be1a171b4f80111d53bb268fbc5 (diff)
test: play with introspection system
Diffstat (limited to 'lib')
-rw-r--r--lib/server.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/server.rb b/lib/server.rb
index 2c8d318..ad3580b 100644
--- a/lib/server.rb
+++ b/lib/server.rb
@@ -3,8 +3,13 @@ require 'json'
require 'graphql'
module Types
- class QueryType < GraphQL::Schema::Object
+ class Cake < GraphQL::Schema::Object
+ field :name, String, null: false
+ end
+
+ class Query < GraphQL::Schema::Object
field :me, String, null: false
+ field :cakes, [Cake], null: false
def me
'mo'
@@ -14,7 +19,7 @@ end
class MySchema < GraphQL::Schema
max_complexity 400
- query Types::QueryType
+ query Types::Query
end
class Server