GraphQL mutation issue with Enum

GraphQL mutation issue with Enum


0

I have object something like below:

type SomeEventInput {
  event: Event 
}

type Event {
  type: EventType! 
}

enum EventType {
MORNING
EVENING
AFTERNOON
MIDNIGHT
}
Mutation.SomeEvent(input: SomeEventInput!): Boolean!

What i am trying to test it something like :

mutation SomeEvent($input: SomeEventInput!) {
    SomeEventInput(input: {Event: {type: MORNING}})
}

But it is showing error for

"message": "Variable "$input" is never used in operation "SomeEvent".",

1

  • 1

    It is right, you aren't using $input anywhere, only declaring it. Did you add that accidentally? Also seems like maybe you want SomeEvent(input: { event: { type: MORNING } })?

    – loganfsmyth

    3 hours ago



Load 3 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *