# GraphQL input enums

**URL:** <https://community.postman.com/t/graphql-input-enums/59544>\
**Category:** Help Hub\
**Tags:** graphql, bug, new-feature\
**Created:** [April 3, 2024, 2:26pm UTC](https://community.postman.com/t/graphql-input-enums/59544 "2024-04-03T14:26:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tompea](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tompea](https://community.postman.com/u/tompea)\
**Post date:** [April 3, 2024, 2:26pm UTC](https://community.postman.com/t/graphql-input-enums/59544/1 "2024-04-03T14:26:25Z")

</div>

So I have recently been using the GraphQL feature to build and run my queries. Some of my queries use ENUMs as an input. When you build these queries via the query builder and enter your input into the box is comes out as a string between quotes. This is not an enum (which requires the quotes to be removed) and so you get this confusing error message  
`Enum "CustomerOrder_OrderType" cannot represent non-enum value: "ORDER". Did you mean the enum value "ORDER"?`

This message should probably use backticks rather than quotes on the example just to differentiate them.

Also is there a way I am missing to escape the quotes when using the input box? It also feels like the input for a type that is a enum should be a drop down of the enums values.

---

<div class="post-metadata">

**Author:** ![meenakshi.dhanani](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/meenakshi.dhanani/32/5980_2.png) [@meenakshi.dhanani](https://community.postman.com/u/meenakshi.dhanani)\
**Post date:** [April 4, 2024, 10:35am UTC](https://community.postman.com/t/graphql-input-enums/59544/2 "2024-04-04T10:35:30Z")

</div>

Hey @tompea 👋 ,  
Thanks for sharing this. I tried using a GraphQL API that takes the input as an enum but didn’t face similar issues. It would be super helpful if you could either provide a screen recording or any screenshots of the error you are facing that would help me reproduce it.

I used the [https://api.cartql.com](https://api.cartql.com) API, SKU is a CartItemType 👇 Also, I’m using the GraphQL v2 client.

![graphql-error](https://us1.discourse-cdn.com/getpostman/original/3X/8/5/85e2518b97be8888484478612d85720445e16371.gif)

P.S. The error message does seem confusing though 🤔

---

<div class="post-metadata">

**Author:** ![tompea](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tompea](https://community.postman.com/u/tompea)\
**Post date:** [April 4, 2024, 11:09am UTC](https://community.postman.com/t/graphql-input-enums/59544/3 "2024-04-04T11:09:24Z")

</div>

Hey @meenakshi.dhanani,

Thanks for getting back to me. What you’ve sent is exactly what I expected to happen. Maybe there is some step I missed in my setup?

This is schema type

```auto
"""Enum for order type."""
enum CustomerOrder_OrderType {
  """Order type is order."""
  ORDER
  """Order type is wishlist."""
  WISHLIST
}

```

I have no dropdown option. I also can’t seem to add an attachment of my screen recording as I am a “new user”

---

<div class="post-metadata">

**Author:** ![tompea](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tompea](https://community.postman.com/u/tompea)\
**Post date:** [April 4, 2024, 11:18am UTC](https://community.postman.com/t/graphql-input-enums/59544/4 "2024-04-04T11:18:46Z")

</div>

Best I can do is this dropbox link

[https://www.dropbox.com/scl/fi/pfl9b9cxmkwfqmbr7eyeo/Screen-Recording-2024-04-04-at-12.01.55.mov?rlkey=oijub80gvz21biw0kgl15nvpo&dl=0](https://www.dropbox.com/scl/fi/pfl9b9cxmkwfqmbr7eyeo/Screen-Recording-2024-04-04-at-12.01.55.mov?rlkey=oijub80gvz21biw0kgl15nvpo&dl=0)

Else I am not sure how to become not a “new use”

“[Dropbox - Screen Recording 2024-04-04 at 12.01.55.mov - Simplify your life](https://www.dropbox.com/scl/fi/pfl9b9cxmkwfqmbr7eyeo/Screen-Recording-2024-04-04-at-12.01.55.mov?rlkey=oijub80gvz21biw0kgl15nvpo&dl=0)”

---

<div class="post-metadata">

**Author:** ![tompea](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tompea](https://community.postman.com/u/tompea)\
**Post date:** [April 4, 2024, 1:43pm UTC](https://community.postman.com/t/graphql-input-enums/59544/5 "2024-04-04T13:43:34Z")

</div>

Can now upload the recording 🙂

---

<div class="post-metadata">

**Author:** ![meenakshi.dhanani](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/meenakshi.dhanani/32/5980_2.png) [@meenakshi.dhanani](https://community.postman.com/u/meenakshi.dhanani)\
**Post date:** [April 8, 2024, 7:03am UTC](https://community.postman.com/t/graphql-input-enums/59544/6 "2024-04-08T07:03:04Z")

</div>

Perfect! Thanks for the screen recording 🙂

That’s funny. I would’ve expected a dropdown for the enums. Could you confirm the schema has parsed the OrderType as an enum?

For instance, I tried validating mine via the Documentation pane on the right.

![graphql-docs](https://us1.discourse-cdn.com/getpostman/original/3X/8/d/8d23bc3db493c3596c9058815ddfaedfa0f3e9c5.gif)

---

<div class="post-metadata">

**Author:** ![tompea](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tompea](https://community.postman.com/u/tompea)\
**Post date:** [April 8, 2024, 8:27am UTC](https://community.postman.com/t/graphql-input-enums/59544/7 "2024-04-08T08:27:54Z")

</div>

My documentation tab does not seem to generate like yours. It does not give me the inputs of my query. I am wondering if this could be related to the fact that my query with inputs is not at the top level? I can confirm the schema is an enum.

---

<div class="post-metadata">

**Author:** ![meenakshi.dhanani](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/meenakshi.dhanani/32/5980_2.png) [@meenakshi.dhanani](https://community.postman.com/u/meenakshi.dhanani)\
**Post date:** [April 8, 2024, 10:58am UTC](https://community.postman.com/t/graphql-input-enums/59544/8 "2024-04-08T10:58:58Z")

</div>

The documentation tab reflects what is selected by the query builder.  
Also, I would expect the CustomerOrder type to be an input type, like here. The screen recording shows the output type I think, probably that’s why I can’t see the `input` keyword.

 ![Screenshot 2024-04-08 at 4.19.28 PM](https://us1.discourse-cdn.com/getpostman/original/3X/0/2/021a888239727b4c8f529f082ea698ae7fe9257d.png)

Meanwhile, I can try checking locally with another API if it behaves the same if the mutation isn’t top level.

---

<div class="post-metadata">

**Author:** ![meenakshi.dhanani](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/meenakshi.dhanani/32/5980_2.png) [@meenakshi.dhanani](https://community.postman.com/u/meenakshi.dhanani)\
**Post date:** [April 8, 2024, 11:25am UTC](https://community.postman.com/t/graphql-input-enums/59544/9 "2024-04-08T11:25:55Z")

</div>

I tested it for a mutation within a level as well, the dropdown still appears.

![level-mutation-graphql](https://us1.discourse-cdn.com/getpostman/original/3X/2/d/2dc93d2a3bbb946f72d61c102197f8550e42ba75.gif)

---

<div class="post-metadata">

**Author:** ![tompea](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tompea](https://community.postman.com/u/tompea)\
**Post date:** [April 9, 2024, 8:34am UTC](https://community.postman.com/t/graphql-input-enums/59544/10 "2024-04-09T08:34:45Z")

</div>

Strange, jsut trying to figure out any differences in our approaches. Is your schema from a schema file or via introspection, mine is via introspection. It is also a Federated GraphQL Service although not sure that should make a differences.

---

<div class="post-metadata">

**Author:** ![meenakshi.dhanani](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/meenakshi.dhanani/32/5980_2.png) [@meenakshi.dhanani](https://community.postman.com/u/meenakshi.dhanani)\
**Post date:** [April 10, 2024, 4:18am UTC](https://community.postman.com/t/graphql-input-enums/59544/11 "2024-04-10T04:18:15Z")

</div>

Hey @tompea,  
I’m using introspection; I don’t think it should matter how the schema is generated if the structure is similar. Let me check if anyone on the product team knows anything more.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [May 10, 2024, 4:18am UTC](https://community.postman.com/t/graphql-input-enums/59544/12 "2024-05-10T04:18:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
