Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/hello_world_schema.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
require "graphql-crystal"

module Kemal::GraphQL
module RootQuery
include ::GraphQL::ObjectType
extend self
field "hello" { "world" }
end

HELLO_WORLD_SCHEMA = ::GraphQL::Schema.from_schema(
%{
schema {
Expand All @@ -11,7 +17,6 @@ module Kemal::GraphQL
hello: String
}
}
).resolve do
query "hello" { "world" }
end
)
HELLO_WORLD_SCHEMA.query_resolver = RootQuery
end