---
url: >-
  https://canary.warp-drive.io/api/@warp-drive/legacy/compat/functions/pushPayload.md
description: >-
  Legacy store method that pushes a raw payload into the store after the
  application serializer, or the given model type's serializer, normalizes it.
---

&#x20;

# &#x20;pushPayload()

```ts
function pushPayload(
   this: Store$1, 
   modelName: string, 
   inputPayload: ObjectValue
): void;
```

Defined in: [warp-drive-packages/legacy/src/compat.ts:357](https://github.com/warp-drive-data/warp-drive/blob/48dc0d277b98008082669dadc6a52e5c5682ef8e/warp-drive-packages/legacy/src/compat.ts#L357)

Push some raw data into the store.

This method can be used both to push in brand new
records, as well as to update existing records. You
can push in more than one type of object at once.
All objects should be in the format expected by the
serializer.

```js [app/serializers/application.js]
import RESTSerializer from '@warp-drive/legacy/serializer/rest';

export default class ApplicationSerializer extends RESTSerializer;
```

```js
let pushData = {
  posts: [
    { id: 1, postTitle: "Great post", commentIds: [2] }
  ],
  comments: [
    { id: 2, commentBody: "Insightful comment" }
  ]
}

store.pushPayload(pushData);
```

By default, the data will be deserialized using a default
serializer (the application serializer if it exists).

Alternatively, `pushPayload` will accept a model type which
will determine which serializer will process the payload.

```js [app/serializers/application.js]
import RESTSerializer from '@warp-drive/legacy/serializer/rest';

 export default class ApplicationSerializer extends RESTSerializer;
```

```js [app/serializers/post.js]
import JSONSerializer from '@warp-drive/legacy/serializer/json';

export default JSONSerializer;
```

```js
store.pushPayload(pushData); // Will use the application serializer
store.pushPayload('post', pushData); // Will use the post serializer
```

## Parameters

### this

`Store$1`

### modelName

`string`

Optionally, a model type used to determine which serializer will be used

### inputPayload

[`ObjectValue`](../../../core/types/json/raw/types/ObjectValue.md)

## Returns

`void`
