# InlineCode

AppSync function code from an inline string.

Extends: Code › InlineCode

- Source: [`aws-appsync/lib/code.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appsync/lib/code.ts#L85)
- Type last changed: v2.60.0 · 12 Jan 2023

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const inlineCode = new appsync.InlineCode('code');
```

## Initializer

```ts
new InlineCode(code: string)
```

## Methods

- `bind(_scope: Construct): CodeConfig` — Bind source code to an AppSync Function or resolver.

- `fromAsset(path: string, options?: AssetOptions): AssetCode` (static) — Loads the function code from a local disk path.

  **Parameters**

  - `path` — The path to the source code file.

- `fromInline(code: string): InlineCode // chainable` (static) — Inline code for AppSync function.

  **Parameters**

  - `code` — The actual handler code (the resulting zip file cannot exceed 4MB).

  **Returns:** `InlineCode` with inline code.
