# @generate causes server panic if only the update mutation for a type is set to true

**URL:** <https://discuss.dgraph.io/t/generate-causes-server-panic-if-only-the-update-mutation-for-a-type-is-set-to-true/18222>\
**Category:** Dgraph Cloud / Slash GraphQL\
**Tags:** schema, dgraph, kind:bug\
**Created:** [February 1, 2023, 9:42am UTC](https://discuss.dgraph.io/t/generate-causes-server-panic-if-only-the-update-mutation-for-a-type-is-set-to-true/18222 "2023-02-01T09:42:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Poolshark](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/poolshark/32/10074_2.png) [@Poolshark](https://discuss.dgraph.io/u/Poolshark)\
**Post date:** [February 1, 2023, 9:42am UTC](https://discuss.dgraph.io/t/generate-causes-server-panic-if-only-the-update-mutation-for-a-type-is-set-to-true/18222/1 "2023-02-01T09:42:27Z")

</div>

### What version of Dgraph are you using?

Dgraph Cloud `v21.03.0-92-g0c9f60156`

### Tell us a little more about your go-environment?

_No response_

### Have you tried reproducing the issue with the latest release?

Yes

### What is the hardware spec (RAM, CPU, OS)?

Tier: 2R  
Storage: 32 GB  
Dgraph Hosted: Yes  
High Availability: No  
SLA: 99.5%  
Schema Mode: Flexible

This error can also be reproduced on a Shared Cluster (Free Tier) with a minimal schema.

### What steps will reproduce the bug?

### 1. Add any type to the schema, eg

```graphql
type GeneateTest 
  @generate(query: { query: true, get: false, aggregate: false }, mutation: {add: false, update: true, delete: false}) { 
  id: ID! test: String 
}

```

### 2. Deploy the schema

### Note

If just a **single generate** for **mutations** is set, the server will respond with a `Panic` when running the single generated mutation.###

### Expected behavior and actual result.

### Expected behaviour

We’d expect that, regarding to which mutations Dgraph auto-generates, we can run these mutations.

### Actual result

Running the mutation

```graphql
mutation { 
  updateGenerateTest(
    input: { 
      filter: { id: "0x1" }, 
      set: { test: "testing" } 
    } 
  ) { 
    numUids
 } 
}

```

results in a Server Panic.

### Additional information

#### The following tests have been executed

- `mutation: { add: false, update: true, delete: false }` → fails
- `mutation: { add: true, update: true, delete: false }` → ok
- `mutation: { add: false, update: true, delete: true }` → ok
- `mutation: { add: true, update: false, delete: false }` → ok
- `mutation: { add: false, update: false, delete: true}` → ok
- `@generate` for `query` seems not to be affected

#### Server Error

> “Internal Server Error - a panic was trapped. This indicates a bug in the GraphQL server. A stack trace was logged. Please let us know by filing an issue with the stack trace.”
