Skip to content
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

fix schema wiring #30

Merged
merged 1 commit into from
Oct 2, 2020
Merged

fix schema wiring #30

merged 1 commit into from
Oct 2, 2020

Conversation

pelletier197
Copy link
Contributor

@pelletier197 pelletier197 commented Sep 29, 2020

Resolves #17

As a temporary fix, at least until it is possible to have fields resolved correctly in onField of ValidationSchemaWiring.

This has the downside to only validate the fields directive parameters on the first call to the graphQL API, which is another problem, because the API will start normally and throw an exception on the first call. It's yours to decide if it's better to fail validation at start, but fail to validate half the queries, or throw an exception on the first call...

@bbakerman bbakerman self-requested a review October 2, 2020 01:27
Copy link
Member

@bbakerman bbakerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. This is an excellent work around until we can fix upstream.

@bbakerman
Copy link
Member

Can I ask that a similar PR get created that targets graphql-java-14-stable branch.

Perhaps @setchy you may be able to help here

@bbakerman bbakerman added this to the 15.x milestone Oct 2, 2020
@bbakerman bbakerman merged commit d70dbe6 into graphql-java:master Oct 2, 2020
setchy pushed a commit to setchy/graphql-java-extended-validation that referenced this pull request Oct 2, 2020
(cherry picked from commit d70dbe6)
setchy added a commit that referenced this pull request Oct 2, 2020
@setchy
Copy link
Collaborator

setchy commented Oct 2, 2020

Sorted - see #33

@bbakerman
Copy link
Member

This is not quite fixed with the PR - that is now if you have self referencing types there is a StackOverflow

input NameRequest {
	         # The title associated to the name
            title: String @Size(min : 1, max : 1)
	        # The given name
	        givenName: String! @Size(min : 1, max : 1)
	        # Middle Name
   	        middleName: String
   	        # Last Name
   	        surName: String!
   	        
   	        # recursion
   	        inner : NameRequest
          }

eg this one. DirectivesAndTypeWalker will stack overflow with such a type because it walks naively

@bbakerman
Copy link
Member

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.

Input Validations are not working on non-nullable input object
3 participants