Skip to content

Commit d48b6d0

Browse files
neudabeileebyron
authored andcommitted
Change Ruby example to print JSON instead of object (graphql#528)
* Change Ruby example to print JSON instead of object This commit converts the result of `Schema.execute` to `json` before printing it renders a more useful result: `{"data":{"hello":"Hello world!"}}` rather than just the object `#<GraphQL::Query::Result:0x00007f893535cf80>`. * oneline
1 parent a1ec46f commit d48b6d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/code/index.html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ Schema = GraphQL::Schema.define do
363363
query QueryType
364364
end
365365
366-
puts Schema.execute('{ hello }')
366+
puts Schema.execute('{ hello }').to_json
367367
\`\`\`
368368
369369
There are also nice bindings for Relay and Rails.

0 commit comments

Comments
 (0)