Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Validation Improvements #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 10, 2023
Merged

Validation Improvements #128

merged 6 commits into from
Sep 10, 2023

Conversation

kevin-carroll
Copy link
Member

@kevin-carroll kevin-carroll commented Sep 9, 2023

  • Added a specific error message when attempting to use a delegate (or Func<>, Action<>) as an argument to a field
  • Improved the error messages for some argument type validation failures such that the the owner of the argument will now be named for easier identification.

Specification Fixes

  • Fixed a bug where non-leaf graph types (OBJECT, INTERFACE, INPUT_OBJECT) that declare no fields were allowed to be added to the schema in some circumstances. An exception will now be thrown at startup. [§3.6][§3.7][§3.10]

Bug Fixes

  • Added a rule to explicitly exclude any fields that accept, as an argument, or return as a value a delegate, Func<>, or Action<>. (i.e. anything that inherits from Delegate)
  • Fixed a bug where an argument to a [Query], [Mutation] or Object field would not properly validate its type in some cases.
  • Fixed a bug where a invalid method or property on an object, interface or controller would cause a startup exception even if that method or property would not have been added as a field on the schema.
  • Fixed a bug where an object, interface or controller with overloaded methods would cause a startup exception even when only one or none of the methods would be included in the schema.
    • An error will still be thrown if multiple overloads are included in a graph type without unique field names.
  • Fixed a bug where inherited methods or properties declared classes Object or ValueType may be parsed by the templating system in some cases.

Templating Changes

  • Altered the ISchemaItemTemplate.ValidateOrThrow() method to include a parameter for optionally validating children
  • Shifted template validating into the Type Makers (previously part of templating). Schema Item Templates are no longer "pre-validated" and only undergo validation if they are being added to a schema.

@kevin-carroll kevin-carroll merged commit 6dab282 into master Sep 10, 2023
@kevin-carroll kevin-carroll deleted the bugs/someBugs branch September 10, 2023 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.