Skip to content

Commit 760d468

Browse files
authored
Merge pull request graphql#1176 from rmosolgo/patch-1
Update graphql-ruby example code
2 parents 145e9ea + b6ac300 commit 760d468

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/code/language-support/ruby/server/graphql-ruby.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Then run `ruby hello.rb` with this code in `hello.rb`:
1717
require 'graphql'
1818

1919
class QueryType < GraphQL::Schema::Object
20-
graphql_name 'Query'
21-
field :hello do
22-
type types.String
23-
resolve -> (obj, args, ctx) { 'Hello world!' }
20+
field :hello, String
21+
22+
def hello
23+
"Hello world!"
2424
end
2525
end
2626

0 commit comments

Comments
 (0)