> For the complete documentation index, see [llms.txt](https://yeti-dev.gitbook.io/apollo-server-adonis-directive-pack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yeti-dev.gitbook.io/apollo-server-adonis-directive-pack/api/mutation/create.md).

# @create

Create a new Lucid model with the given arguments.

{% hint style="warning" %}
Required argument when writing a mutation:

* input - type Input
  {% endhint %}

### For a separate add use

```javascript
/* ... */
const {
  CreateDirective,
  CreateTypeDefs
} = require('apollo-server-adonis-directives-pack/src/directives/mutation/Create')

makeExecutableSchema({ 
  /* ... */ 
  typeDefs: [ CreateTypeDefs, /* ... */ ],
  schemaDirectives: { CreateDirective, /* ... */} 
})
```

### Definition

{% code title="CreateTypeDefs" %}

```graphql
directive @create(
  # By default, the model will be calculated from the name
  # of the returned "type" with the prefix 'App/Model/'
  model: String) on FIELD_DEFINITION
```

{% endcode %}

{% hint style="success" %}
Use the @create directive only to create one new model
{% endhint %}

### Example

```graphql
input CreatePostInput {
    name: String!
    text: String
}

type Mutation {
    createPost(input: CreatePostInput!): Post @create
}
```
