-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with Hello World schema #6
Comments
I figured it out, this was the "old" style that seems to be deprecated now. (I like the simpler old style btw :) ) The change I had to do to the Hello world example to work is the following 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 {
query: RootQuery
}
type RootQuery {
hello: String
}
}
)
HELLO_WORLD_SCHEMA.query_resolver = RootQuery
end
|
hey Kefah,
thanks for your help. If you like you could open a pull request to fix the example!
Kefah T. Issa writes:
… I figured it out, this was the "old" style that seems to be deprecated now. (I like the simpler old style btw :) )
The change I had to do to the Hello world example is work is the following
```crystal
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 {
query: RootQuery
}
type RootQuery {
hello: String
}
}
)
HELLO_WORLD_SCHEMA.query_resolver = RootQuery
end
```
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When enabling hello_world_schema the following compiler error is thrown:
The way how that hello world example is written is very nice and good for simple cases. But it seems some maintenance is needed there.
The text was updated successfully, but these errors were encountered: