René's URL Explorer Experiment


Title: Bugfix: spec-compliant behaviour for non-nullable types with default values. by folone · Pull Request #2573 · graphql-java/graphql-java · GitHub

Open Graph Title: Bugfix: spec-compliant behaviour for non-nullable types with default values. by folone · Pull Request #2573 · graphql-java/graphql-java

X Title: Bugfix: spec-compliant behaviour for non-nullable types with default values. by folone · Pull Request #2573 · graphql-java/graphql-java

Description: Hi folks! Problem Graphql-java currently fails the document validation for queries that use nullable types for non-nullable schema field arguments with default values. As per spec: A notable exception to typical variable type compatibility is allowing a variable definition with a nullable type to be provided to a non‐null location as long as either that variable or that location provides a default value. Here's a discussion from 2018 where this change to the spec was adopted: graphql/graphql-spec#418. Motivating example: Schema: type Query { hello(arg: Boolean! = true) } Query: query Test($var: Boolean) { hello(arg: $var) } This is expected to pass the validation, but currently fails: ValidationError{validationErrorType=VariableTypeMismatch, queryPath=[hello], message=Validation error of type VariableTypeMismatch: Variable type 'Boolean' doesn't match expected type 'Boolean!' @ 'hello', locations=[SourceLocation{line=3, column=25}], description='Variable type 'Boolean' doesn't match expected type 'Boolean!''} Solution This patch fixes the issue by extracting the schema-defined default value for the argument (if present), and checks that in the VariablesTypeMatcher along with the original check. This also adds a regression test to exercise this fix, similar to the test in the reference GraphQL implementation.

Open Graph Description: Hi folks! Problem Graphql-java currently fails the document validation for queries that use nullable types for non-nullable schema field arguments with default values. As per spec: A notable excep...

X Description: Hi folks! Problem Graphql-java currently fails the document validation for queries that use nullable types for non-nullable schema field arguments with default values. As per spec: A notable excep...

Opengraph URL: https://github.com/graphql-java/graphql-java/pull/2573

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:248d54ba-807d-7fbe-10f1-530e216825ad
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD432:8A973:196B52:21F642:6A616B6D
html-safe-nonce11c0a74e620ea3a454f37674e1203dc74600b49b5f2a7908bf2848a5c9183db4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDMyOjhBOTczOjE5NkI1MjoyMUY2NDI6NkE2MTZCNkQiLCJ2aXNpdG9yX2lkIjoiNjMzMzY0MDMyMDE2MjU1Njc4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca1a4856dc9caa5802dda9a79ec3228f9777b6b406fa0fdc26df49821522014ca
hovercard-subject-tagpull_request:749862831
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/graphql-java/graphql-java/pull/2573/files
twitter:imagehttps://avatars.githubusercontent.com/u/366132?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/366132?s=400&v=4
og:image:altHi folks! Problem Graphql-java currently fails the document validation for queries that use nullable types for non-nullable schema field arguments with default values. As per spec: A notable excep...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonea69385f7d268ece7ad25b131bbd70f457024811fc79afcae43785a6849b724e2
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git
octolytics-dimension-user_id14289921
octolytics-dimension-user_logingraphql-java
octolytics-dimension-repository_id38602457
octolytics-dimension-repository_nwographql-java/graphql-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id38602457
octolytics-dimension-repository_network_root_nwographql-java/graphql-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release484cf265a1f970d5c7a5e7c37cb677d8010aa12f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/graphql-java/graphql-java/pull/2573/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fpull%2F2573%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fpull%2F2573%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=graphql-java%2Fgraphql-java
Reloadhttps://github.com/graphql-java/graphql-java/pull/2573/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/2573/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/2573/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/2573/files
graphql-java https://github.com/graphql-java
graphql-javahttps://github.com/graphql-java/graphql-java
Notifications https://github.com/login?return_to=%2Fgraphql-java%2Fgraphql-java
Fork 1.1k https://github.com/login?return_to=%2Fgraphql-java%2Fgraphql-java
Star 6.2k https://github.com/login?return_to=%2Fgraphql-java%2Fgraphql-java
Code https://github.com/graphql-java/graphql-java
Issues 26 https://github.com/graphql-java/graphql-java/issues
Pull requests 11 https://github.com/graphql-java/graphql-java/pulls
Discussions https://github.com/graphql-java/graphql-java/discussions
Actions https://github.com/graphql-java/graphql-java/actions
Projects https://github.com/graphql-java/graphql-java/projects
Wiki https://github.com/graphql-java/graphql-java/wiki
Security and quality 0 https://github.com/graphql-java/graphql-java/security
Insights https://github.com/graphql-java/graphql-java/pulse
Code https://github.com/graphql-java/graphql-java
Issues https://github.com/graphql-java/graphql-java/issues
Pull requests https://github.com/graphql-java/graphql-java/pulls
Discussions https://github.com/graphql-java/graphql-java/discussions
Actions https://github.com/graphql-java/graphql-java/actions
Projects https://github.com/graphql-java/graphql-java/projects
Wiki https://github.com/graphql-java/graphql-java/wiki
Security and quality https://github.com/graphql-java/graphql-java/security
Insights https://github.com/graphql-java/graphql-java/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgraphql-java%2Fgraphql-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgraphql-java%2Fgraphql-java%2Fissues%2Fnew%2Fchoose
bbakermanhttps://github.com/bbakerman
graphql-java:masterhttps://github.com/graphql-java/graphql-java/tree/master
folone:gleontiev/schema-default-valuehttps://github.com/folone/graphql-java/tree/gleontiev/schema-default-value
Conversation 5 https://github.com/graphql-java/graphql-java/pull/2573
Commits 2 https://github.com/graphql-java/graphql-java/pull/2573/commits
Checks 0 https://github.com/graphql-java/graphql-java/pull/2573/checks
Files changed https://github.com/graphql-java/graphql-java/pull/2573/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/2573/files
Bugfix: spec-compliant behaviour for non-nullable types with default values. https://github.com/graphql-java/graphql-java/pull/2573/files#top
Show all changes 2 commits https://github.com/graphql-java/graphql-java/pull/2573/files
4528bb2 Bugfix: don't fail document validation when nullable type is provided… Oct 5, 2021 https://github.com/graphql-java/graphql-java/pull/2573/commits/4528bb2925f2f3b8acda40d19610a2b085a6bbd7
e5d0db5 Fix failing tests. Oct 5, 2021 https://github.com/graphql-java/graphql-java/pull/2573/commits/e5d0db505fa2df078ff95af3a4a83304c53fa030
Clear filters https://github.com/graphql-java/graphql-java/pull/2573/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/2573/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/2573/files
VariableTypesMatchRule.java https://github.com/graphql-java/graphql-java/pull/2573/files#diff-e3626ca5d1799f3b213fb8bf2e24db41acb47965bb57eeba256473d6a036a563
GraphQLTest.groovy https://github.com/graphql-java/graphql-java/pull/2573/files#diff-cb8d1f72e58504480a1b5127ea74d3038902d5ee8b99f353c2f2f8cf0a5feb8e
VariableTypesMatchRuleTest.groovy https://github.com/graphql-java/graphql-java/pull/2573/files#diff-02f40bfd623f8ea3f0b65b7cd3c600ac3a66f80c73a728dc4e9653c7637109b1
src/main/java/graphql/validation/rules/VariableTypesMatchRule.javahttps://github.com/graphql-java/graphql-java/pull/2573/files#diff-e3626ca5d1799f3b213fb8bf2e24db41acb47965bb57eeba256473d6a036a563
View file https://github.com/folone/graphql-java/blob/e5d0db505fa2df078ff95af3a4a83304c53fa030/src/main/java/graphql/validation/rules/VariableTypesMatchRule.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/2573/{{ revealButtonHref }}
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-e3626ca5d1799f3b213fb8bf2e24db41acb47965bb57eeba256473d6a036a563
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-e3626ca5d1799f3b213fb8bf2e24db41acb47965bb57eeba256473d6a036a563
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-e3626ca5d1799f3b213fb8bf2e24db41acb47965bb57eeba256473d6a036a563
bbakermanhttps://github.com/bbakerman
Oct 9, 2021https://github.com/graphql-java/graphql-java/pull/2573/files#r725425151
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@andimarekhttps://github.com/andimarek
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/2573/files
andimarekhttps://github.com/andimarek
Dec 20, 2021https://github.com/graphql-java/graphql-java/pull/2573/files#r772066159
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/2573/files
folonehttps://github.com/folone
Dec 22, 2021https://github.com/graphql-java/graphql-java/pull/2573/files#r773836543
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@andimarekhttps://github.com/andimarek
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/2573/files
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-e3626ca5d1799f3b213fb8bf2e24db41acb47965bb57eeba256473d6a036a563
src/test/groovy/graphql/GraphQLTest.groovyhttps://github.com/graphql-java/graphql-java/pull/2573/files#diff-cb8d1f72e58504480a1b5127ea74d3038902d5ee8b99f353c2f2f8cf0a5feb8e
View file https://github.com/folone/graphql-java/blob/e5d0db505fa2df078ff95af3a4a83304c53fa030/src/test/groovy/graphql/GraphQLTest.groovy
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/2573/{{ revealButtonHref }}
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-cb8d1f72e58504480a1b5127ea74d3038902d5ee8b99f353c2f2f8cf0a5feb8e
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-cb8d1f72e58504480a1b5127ea74d3038902d5ee8b99f353c2f2f8cf0a5feb8e
src/test/groovy/graphql/validation/rules/VariableTypesMatchRuleTest.groovyhttps://github.com/graphql-java/graphql-java/pull/2573/files#diff-02f40bfd623f8ea3f0b65b7cd3c600ac3a66f80c73a728dc4e9653c7637109b1
View file https://github.com/folone/graphql-java/blob/e5d0db505fa2df078ff95af3a4a83304c53fa030/src/test/groovy/graphql/validation/rules/VariableTypesMatchRuleTest.groovy
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/2573/{{ revealButtonHref }}
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-02f40bfd623f8ea3f0b65b7cd3c600ac3a66f80c73a728dc4e9653c7637109b1
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-02f40bfd623f8ea3f0b65b7cd3c600ac3a66f80c73a728dc4e9653c7637109b1
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-02f40bfd623f8ea3f0b65b7cd3c600ac3a66f80c73a728dc4e9653c7637109b1
https://github.com/graphql-java/graphql-java/pull/2573/files#diff-02f40bfd623f8ea3f0b65b7cd3c600ac3a66f80c73a728dc4e9653c7637109b1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.