# Schema not defined for predicate

**URL:** https://discuss.dgraph.io/t/schema-not-defined-for-predicate/14282
**Category:** GraphQL
**Tags:** kind:question
**Created:** [May 23, 2021, 10:28am UTC](https://discuss.dgraph.io/t/schema-not-defined-for-predicate/14282 "2021-05-23T10:28:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![codinghusi](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/codinghusi/32/6573_2.png) [@codinghusi](https://discuss.dgraph.io/u/codinghusi)
#### Post date: [May 23, 2021, 10:28am UTC](https://discuss.dgraph.io/t/schema-not-defined-for-predicate/14282/1 "2021-05-23T10:28:27Z")

</div>

Hey,  
I’m a beginner in fields of GraphQL and also Dgraph, so I faced the following error.  
Is this a bug or am I doing something completely wrong?

For clarification: I wanted to move the fields outside the type, so I can generate dropdowns from distinct field values.

# Error I get after my request

```auto
Error: mutation addWorker failed because Dgraph execution failed because : Got error: Schema not defined for predicate: WorkerField.value. while running: name:"eq" args:"2" 

```

# My Schema

```auto
# Dgraph.Allow-Origin "*" 

enum WorkerFieldType {
  TL_SECTION
  SEGMENT
  WORK_AREA
}

type Worker {
  id: ID!
  name: String! @id
  tlSection: WorkerField!
  segment: WorkerField!
  workArea: WorkerField!
  process: WorkProcess
}

type WorkerField {
  id: ID!
  value: String! @id
  fieldType: WorkerFieldType!
}

type WorkProcess {
  id: ID!
  name: String
  workers: [Worker] @hasInverse(field: "process")
}

```

# My Query

```auto
mutation AddWorker($data: AddWorkerInput!) {
    addWorker(input: [$data]) {
        worker {
            id
        }
    }
}

```

# My variables

```auto
{
   "data":{
      "name":"asdf",
      "tlSection":{
         "value":"2",
         "fieldType":"TL_SECTION"
      },
      "segment":{
         "value":"1",
         "fieldType":"SEGMENT"
      },
      "workArea":{
         "value":"3",
         "fieldType":"WORK_AREA"
      }
   }
}

```

---

<div class="post-metadata">

### Author: ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)
#### Post date: [May 24, 2021, 4:46am UTC](https://discuss.dgraph.io/t/schema-not-defined-for-predicate/14282/2 "2021-05-24T04:46:10Z")

</div>

Is there an original schema you migrated from?

---

<div class="post-metadata">

### Author: ![codinghusi](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/codinghusi/32/6573_2.png) [@codinghusi](https://discuss.dgraph.io/u/codinghusi)
#### Post date: [May 24, 2021, 9:16am UTC](https://discuss.dgraph.io/t/schema-not-defined-for-predicate/14282/3 "2021-05-24T09:16:37Z")

</div>

Oh dang, I thought I had wiped the docker container…  
Turns out I didn’t. Removing the volume actually fixed my problem ^^  
Thank you very much for helping me out 🙂
