# Saving JSON response

**URL:** <https://discuss.dgraph.io/t/saving-json-response/13370>\
**Category:** GraphQL\
**Created:** [March 24, 2021, 12:49pm UTC](https://discuss.dgraph.io/t/saving-json-response/13370 "2021-03-24T12:49:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MKS-01](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/mks-01/32/6612_2.png) [@MKS-01](https://discuss.dgraph.io/u/MKS-01)\
**Post date:** [March 24, 2021, 12:49pm UTC](https://discuss.dgraph.io/t/saving-json-response/13370/1 "2021-03-24T12:49:07Z")

</div>

I want to save resume information as json into dgraph database based on my defined schema which is very similar to the structure of the json, but without the need to give the same structure in the mutation or create a map from schema to json in mutation. Is there a way to do the above

```auto
  {
            "ContactInformation": {
                "CandidateName": {
                    "FormattedName": "Dev Test",
                    "GivenName": "Dev",
                    "FamilyName": "Dev"
                },
                "Telephones": [
                    {
                        "Raw": "404-663-1274",
                        "Normalized": "+1 404-663-1274",
                        "InternationalCountryCode": "1",
                        "AreaCityCode": "404",
                        "SubscriberNumber": "45-1274"
                    }
                ],
                "EmailAddresses": [
                    "dev@mail.com"
                ],
                "WebAddresses": [
                    {
                        "Address": "https://www.linkedin.com/in/dev_test",
                        "Type": "LinkedIn"
                    }
                ]
            }
        }

```

---

<div class="post-metadata">

**Author:** ![verneleem](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/verneleem/32/5801_2.png) [@verneleem](https://discuss.dgraph.io/u/verneleem)\
**Post date:** [March 24, 2021, 3:04pm UTC](https://discuss.dgraph.io/t/saving-json-response/13370/2 "2021-03-24T15:04:21Z")

</div>

> [@MKS-01](#):
>
> my defined schema which is very similar to the structure of the json, but without the need to give the same structure

This is tagged GraphQL, so using only the GraphQL API, the answer is no.

GraphQL is a strictly typed API. It only allows in exactly what is predefined in the schema. It can accept less (unless required inputs) but it cannot accept more.

> [@MKS-01](#):
>
> I want to save resume information as json into dgraph database

This however is possible with DQL, but if not correctly typed it will not be accessible by the GraphQL API endpoint generated from your pre-defined GraphQL schema.

Behind the GraphQL API endpoint is the Dgraph database. Dgraph is a loosely typed database and you can add data in through the bulk loader, live loader, or mutate endpoint that does not match any predefined schema exactly. JSON data can be added through the mutate endpoint, bulk loader and live loader (thanks for the correction @MichelDiz)

In answering your question, it is possible to “save” JSON responses directly to Dgraph, but not with the GraphQL API, and these saved JSON responses will not be exposed to your GraphQL API to later query, and mutate unless they are first typed correctly.

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [March 25, 2021, 12:35pm UTC](https://discuss.dgraph.io/t/saving-json-response/13370/3 "2021-03-25T12:35:09Z")

</div>

> [@verneleem](#):
>
> JSON data can only be added through the mutate endpoint though, as bulk loader and live loader both require RDF formatted triples.

Correcting this, Dgraph accepts JSON in both loaders.

```auto
➜ ~ dgraph live -h | grep json
  -f, --files string Location of *.rdf(.gz) or *.json(.gz) file(s) to load
      --format string Specify file format (rdf or json) instead of getting it from filename

```

Also, it exports it in JSON. [https://dgraph.io/docs/deploy/admin/](https://dgraph.io/docs/deploy/dgraph-administration/#export-data-format)
