Graphiql: Possible to define an input field more than once if part of a list

Created on 8 May 2017  ·  2Comments  ·  Source: graphql/graphiql

Moved from https://github.com/graphql/graphiql/issues/441
I have an input object that has a list of input objects

mutation createConversation(input: CreateConversationInput!): ConversationMutation

Input Object: CreateConversationInput
messages: [MessageWrapperInput]!

MessageWrapperInput
message: MessageInput
title: TitleInput

Input Object: MessageInput
color: String!
text: String!

Input Object: TitleInput
color: String!
text: String!

The following query is valid according to GraphiQL

mutation {
  createConversation(input: {
  messages: [
    {
      message: {
        text: “a”
      },
      message: {
        text: “b”
      }
    }
  ]}){…
  }
}

But I have redefined the message input object in a single list entry.

Expected:
I should get a warning like: "There can only be one input field named message for each list entry"

The correct query for reference should be something like:

mutation {
  createConversation(input: {
  messages: [
    {
      message: {
        text: “a”
      }
   },
   {
      message: {
        text: “b”
      }
    }
  ]}){…
  }
}
bug language-parser

Most helpful comment

I think this bug has been fixed since the version of 14.2.0 of graphql.

All 2 comments

How does graphql handle this? Does it report an issue?

I think this bug has been fixed since the version of 14.2.0 of graphql.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wmertens picture wmertens  ·  31Comments

intellix picture intellix  ·  10Comments

Glavin001 picture Glavin001  ·  10Comments

fson picture fson  ·  17Comments

songololo picture songololo  ·  25Comments