-
-
Save akhtarja/7a0557614aa2de6ed1119ed82586a433 to your computer and use it in GitHub Desktop.
Blog post 3 - Returning a JSON Field From Rails GraphQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GraphqlUtils::Types | |
Json = GraphQL::ScalarType.define do | |
name 'JSON' | |
description 'JSON type' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
field :aJSONField, | |
GraphqlUtils::Types::Json, | |
'A field with freeform JSON data', | |
property: :a_json_field |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment