Skip to content

Change Ruby example to print JSON instead of object #528

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

Merged
merged 2 commits into from
Jun 29, 2018

Conversation

neudabei
Copy link
Contributor

@neudabei neudabei commented Jun 15, 2018

I wondered whether changing the Ruby example of the server side code might be useful. Converting the result of Schema.execute to json before printing it renders a more readable result: {"data":{"hello":"Hello world!"}} rather than just the object #<GraphQL::Query::Result:0x00007f893535cf80>.

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>`.
@leebyron
Copy link
Collaborator

Sure, these are intended to be minimal examples, but happy to include this convenience since it's a small change

@leebyron leebyron merged commit d48b6d0 into graphql:source Jun 29, 2018
@neudabei
Copy link
Contributor Author

neudabei commented Jul 2, 2018

Makes sense. Thanks @leebyron!

Dipeshwagle pushed a commit to Dipeshwagle/graphql.github.io that referenced this pull request Aug 18, 2020
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants