# GraphQL setAppStoredCustomEntity not working

**URL:** <https://community.developer.atlassian.com/t/graphql-setappstoredcustomentity-not-working/78291>\
**Category:** Forge\
**Tags:** graphql, forge-remote, forge-storage\
**Created:** [March 14, 2024, 3:49pm UTC](https://community.developer.atlassian.com/t/graphql-setappstoredcustomentity-not-working/78291 "2024-03-14T15:49:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxiGlein](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@MaxiGlein](https://community.developer.atlassian.com/u/MaxiGlein)\
**Post date:** [March 14, 2024, 3:49pm UTC](https://community.developer.atlassian.com/t/graphql-setappstoredcustomentity-not-working/78291/1 "2024-03-14T15:49:08Z")

</div>

Hi,

I’m trying to set custom entities in my remote backend with the system token provided.  
Accessing the Storage API with a GraphQL client is working fine, but trying to write always leads to a 500 internal server error returned by the GraphQL API

This is my mutation:

```auto
mutation forge_app_setApplicationStorageCustomEntity($input: SetAppStoredCustomEntityMutationInput!) {
  appStorageCustomEntity {
		setAppStoredCustomEntity(input: $input) {
      success
      errors {
        message
        extensions {
          errorType
          statusCode
        }
      }
    }
  }
}

```

And input:

```auto
{
  "input": {
    "contextAri": "<my ari>",
    "key": "key1",
    "entityName": "test",
    "value": "{\"name\":\"first entity\"}" 
  }
}

```

Can someone help me? 🙂

Best regards,  
Maxi

---

<div class="post-metadata">

**Author:** ![MaxiGlein](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@MaxiGlein](https://community.developer.atlassian.com/u/MaxiGlein)\
**Post date:** [March 14, 2024, 3:51pm UTC](https://community.developer.atlassian.com/t/graphql-setappstoredcustomentity-not-working/78291/2 "2024-03-14T15:51:32Z")

</div>

Here is the returned error:

```auto
{
  "data": {
    "appStorageCustomEntity": {
      "setAppStoredCustomEntity": {
        "success": false,
        "errors": [
          {
            "message": "An unexpected error occurred",
            "extensions": {
              "errorType": "INTERNAL_SERVER_ERROR",
              "statusCode": 500
            }
          }
        ]
      }
    }
  },
  "extensions": {
    "gateway": {
      "request_id": "e47f03e4b8ee4c9897b12bc06d30dd9f",
      "crossRegion": false,
      "edgeCrossRegion": false
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![MaxiGlein](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@MaxiGlein](https://community.developer.atlassian.com/u/MaxiGlein)\
**Post date:** [March 25, 2024, 10:23am UTC](https://community.developer.atlassian.com/t/graphql-setappstoredcustomentity-not-working/78291/3 "2024-03-25T10:23:49Z")

</div>

Apparently, the GraphQL API updated and shows good error messages now 🙂

For the solution, I did not pass the JSON value correctly:

```auto
"value": {"name":"first entity"}

```

It has to be a real JSON value, not escaped as string as I did it 🤦‍♂️  
The GraphQL explorer even showed an error back then when trying like that 😕
