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

Add validation to prevent arguments with both required and default_value #3011

Merged
merged 4 commits into from
Jul 21, 2020

Conversation

Diego-Thomaz
Copy link
Contributor

Close #3001

Copy link
Contributor

@lairtonlelis lairtonlelis left a comment

Choose a reason for hiding this comment

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

Just a small change 💅 . The rest LGTM.

spec/graphql/schema/argument_spec.rb Outdated Show resolved Hide resolved
Co-authored-by: Lairton Lélis <lairtonlelis@gmail.com>
Copy link
Owner

@rmosolgo rmosolgo 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 taking a crack at this! I left a couple of suggestions.

lib/graphql/schema/argument.rb Outdated Show resolved Hide resolved
lib/graphql/schema/argument.rb Show resolved Hide resolved
@Diego-Thomaz
Copy link
Contributor Author

@rmosolgo take a look and let me know if it is ok now!

Copy link
Owner

@rmosolgo rmosolgo left a comment

Choose a reason for hiding this comment

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

Awesome, thanks again for taking care of this!

@rmosolgo
Copy link
Owner

rmosolgo commented Aug 7, 2020

Sorry @Diego-Thomaz , I made a mistake on this one -- apparently there are cases where default_value: and required: true make sense (graphql/graphql-spec#418). Maybe I named required: wrongly 😖

@Diego-Thomaz
Copy link
Contributor Author

Sorry @Diego-Thomaz , I made a mistake on this one -- apparently there are cases where default_value: and required: true make sense (graphql/graphql-spec#418). Maybe I named required: wrongly 😖

No problem @rmosolgo I was glad to help anyway.

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.

Arguments should prevent _both_ default_value and required: true
3 participants