# Parse a subgraph event that has a struct

**URL:** <https://forum.thegraph.com/t/parse-a-subgraph-event-that-has-a-struct/3404>\
**Category:** Questions\
**Tags:** subgraph-devs\
**Created:** [June 9, 2022, 12:27pm UTC](https://forum.thegraph.com/t/parse-a-subgraph-event-that-has-a-struct/3404 "2022-06-09T12:27:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![solod](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@solod](https://forum.thegraph.com/u/solod)\
**Post date:** [June 9, 2022, 12:27pm UTC](https://forum.thegraph.com/t/parse-a-subgraph-event-that-has-a-struct/3404/1 "2022-06-09T12:27:10Z")

</div>

```auto
Subgraph error 1/1, code: SubgraphSyncingFailure, error: Mapping aborted at generated/schema.ts, line 212, column 12, with message: unexpected null wasm backtrace

```

generated/schema.ts, line 212

```auto
210 get subdata(): Array<string> {
211 let value = this.get("subdata");
212 return value!.toStringArray();
213 }

```

contract.sol

```auto
    event Hello(address indexed owner, Data data);

    struct Subdata {
        string one;
        string two;
    }

    struct Data {
        string name;
        Subdata[] subdata;
    }

```

subgraph.yaml

```auto
      eventHandlers:
        - event: Hello(indexed address,(string,(string,string)[]))
          handler: handleHello

```

How to in mapping.ts get `data` and `subdata` struct?

`event.params.data.subdata` have error.

---

<div class="post-metadata">

**Author:** ![solod](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@solod](https://forum.thegraph.com/u/solod)\
**Post date:** [June 9, 2022, 4:26pm UTC](https://forum.thegraph.com/t/parse-a-subgraph-event-that-has-a-struct/3404/3 "2022-06-09T16:26:38Z")

</div>

Solved a problem.

I added the ID to the automatic field.  
Because of this there was an error.

```auto
type Data @entity {
  id: ID!
  subdata: [Subdata!] @derivedFrom(field: "data")
}

```

```auto
data.subdata.push(id) // error

```
