Skip to content

Commit b6ac300

Browse files
authored
Update graphql-ruby example code
GraphQL-Ruby has had some schema definition updates, so I thought I'd update this doc.
1 parent 62cede4 commit b6ac300

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)