# Resolving updateGQLSchema failed because Type User: @auth: failed to validate GraphQL rule \[reason : Field "eq" is not defined by type ID.\]

**URL:** https://discuss.dgraph.io/t/resolving-updategqlschema-failed-because-type-user-auth-failed-to-validate-graphql-rule-reason-field-eq-is-not-defined-by-type-id/17099
**Category:** Dgraph Cloud
**Created:** [April 1, 2022, 11:12am UTC](https://discuss.dgraph.io/t/resolving-updategqlschema-failed-because-type-user-auth-failed-to-validate-graphql-rule-reason-field-eq-is-not-defined-by-type-id/17099 "2022-04-01T11:12:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BenW](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/benw/32/7532_2.png) [@BenW](https://discuss.dgraph.io/u/BenW)
#### Post date: [April 1, 2022, 11:12am UTC](https://discuss.dgraph.io/t/resolving-updategqlschema-failed-because-type-user-auth-failed-to-validate-graphql-rule-reason-field-eq-is-not-defined-by-type-id/17099/1 "2022-04-01T11:12:11Z")

</div>

Weird error. If I paste my schema into Dgraph Cloud and deploy it I get the following error:

```auto
resolving updateGQLSchema failed because Type User: @auth: failed to validate GraphQL rule [reason : Field "eq" is not defined by type ID.]

```

The User type from my schema:

```auto
type User @auth(
  query: { or: [
    { rule: """
        query($EMAIL: String!) {
          queryUser(filter: {
            email: {
              eq: $EMAIL
            }
          }) {
            id
          }
        }
      """
    }
    { rule: """
        query($USERID: String!) {
          queryUser(filter: {
            id: {
              eq: $USERID
            }
          }) {
            id
          }
        }
      """
    }
    { rule: "{$ROLE: { eq: \"ADMIN\" } }" }
  ]}
  add: { or: [
    { rule: "{ $ROLE: { eq: \"ADMIN\" } }" }
    { rule: """
        query($EMAIL: String!) {
          queryUser(filter: {
            email: {
              eq: $EMAIL
            }
          }) {
            id
          }
        }
      """
    }
  ]},
) {
  id: ID!
  email: String! @id
  username: String
  stripeCustomerId: String
}

```

EDIT: So I verified that it has a problem with this specific rule:

```auto
    { rule: """
        query($USERID: String!) {
          queryUser(filter: {
            id: {
              eq: $USERID
            }
          }) {
            id
          }
        }
      """
    }

```

---

<div class="post-metadata">

### Author: ![BenW](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/benw/32/7532_2.png) [@BenW](https://discuss.dgraph.io/u/BenW)
#### Post date: [April 1, 2022, 12:05pm UTC](https://discuss.dgraph.io/t/resolving-updategqlschema-failed-because-type-user-auth-failed-to-validate-graphql-rule-reason-field-eq-is-not-defined-by-type-id/17099/2 "2022-04-01T12:05:54Z")

</div>

Changing the rule in question to the following fixed the issue. For some reason `eq:` doesn’t work with `ID` fields and the `$USERID` value from the JWT needs to be typed as `ID!`:

```auto
    { rule: """
        query($USERID: ID!) {
          queryUser(filter: {
            id: [$USERID]
          }) {
            id
          }
        }
      """
    }

```
