ash_graphql/documentation/topics/use-json-with-graphql.md

13 lines
465 B
Markdown
Raw Normal View History

# Use JSON with GraphQL
2021-06-16 03:25:11 +12:00
AshGraphql provides two JSON types that may be used. They are the same except for how the type is serialized in responses.
2021-06-16 03:25:11 +12:00
- `:json_string` - serializes the json to a string, e.g `"{\"foo\":1}"`
- `:json` - leaves the json as an object, e.g `{foo: 1}`
By default, `:json_string` is used. The configuration for this is (uncharacteristically) placed in application config, for example:
```elixir
config :ash_graphql, :json_type, :json
```