Netflix/dgs-framework

InputMapDefinesTooManyFieldsException: Cancel Field Validation

shijie-world opened this issue · 1 comments

内容:
plaintext
Hello,

I'm currently working with GraphQL and encountered an issue with the InputMapDefinesTooManyFieldsException. This exception occurs when an undefined field is included in the input variable of a GraphQL mutation.

Here's an instance of the problem:

If our input type is defined as:

input BookInput {
  title: String
  author: String
}
And we includes an undefined field like this:
graphql
mutation {
  createBook(input: { title: "My Book", author: "Me", publicationDate: "2022" }) {
    id
  }
}
The InputMapDefinesTooManyFieldsException is thrown as the publicationDate field is not defined for BookInput.
I understand this is designed to help catch errors and avoid issues. However, due to my specific needs, I would like to know if there is a way to cancel, or bypass, this field validation functionality?
I've tried looking through the available configuration settings, documentation, and source code, but I couldn't find anything related to this feature.
Any guidance or suggestions on this would be greatly appreciated.
Thank you.

This validation is actually done by graphql-java and not the DGS framework. Unfortunately, I am not aware of a way to bypass this check. I'm going to close this issue since this is not something we can address in the dgs framework.