René's URL Explorer Experiment


Title: OneOf inhabitability fixes by jbellenger · Pull Request #4458 · graphql-java/graphql-java · GitHub

Open Graph Title: OneOf inhabitability fixes by jbellenger · Pull Request #4458 · graphql-java/graphql-java

X Title: OneOf inhabitability fixes by jbellenger · Pull Request #4458 · graphql-java/graphql-java

Description: OneOf input objects can be defined in a way that makes it impossible to create a value for that type. This breaks the spec's unwritten requirement that all input types be inhabited. The simplest example of an uninhabited OneOf is the self-recursing input Foo @oneOf { foo:Foo }. Trying to create a value for this type requires an infinitely nested object value, and should be invalid for the same reason that the spec currently considers the non-OneOf variant input Foo { foo:Foo! } to be invalid. I have an open spec PR that updates the recursive input object requirements to consider OneOf input objects. The proposed algorithm was implemented in graphql-js here. I previously added a version of these rules to graphql-java, but this was before I had a complete grasp on the problem and the validation is incomplete. For example, this mixed-OneOf type graph also requires infinite values and is incorrectly allowed by graphql-java: input Foo @oneOf { bar:Bar } input Bar { foo:Foo! } This PR closes this validation hole by porting over graphql-js's implementation of this validator. Perf The validator runs once per schema. It uses a worklist algorithm and takes time that is linear relative to the total number of input object fields in a schema. I've included a benchmark that tests a variety of different schemas: Benchmark Mode Cnt Score Error Units InputObjectHasUnbreakableCycleBenchmark.finiteValuePropagation avgt 6 33.829 ± 5.185 us/op InputObjectHasUnbreakableCycleBenchmark.tenTypeMixedInputCycle avgt 6 34.151 ± 4.320 us/op InputObjectHasUnbreakableCycleBenchmark.tenTypeTenFieldsInputCycle avgt 6 52.809 ± 8.401 us/op InputObjectHasUnbreakableCycleBenchmark.twoTypeMixedInputCycle avgt 6 28.624 ± 3.921 us/op The takeaway is that performance is relatively stable even for pathological input object graphs.

Open Graph Description: OneOf input objects can be defined in a way that makes it impossible to create a value for that type. This breaks the spec's unwritten requirement that all input types be inhabited. The simples...

X Description: OneOf input objects can be defined in a way that makes it impossible to create a value for that type. This breaks the spec's unwritten requirement that all input types be inhabited. The sim...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:37af6c7a-9170-070e-a925-0d6e70263931
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBCF4:96DDF:2400766:2D97C90:6B017C6D
html-safe-noncef29d1d803a702e8b9dae81cf40fe129dc341fd5a3a3e2810ee2d7faf4c083236
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0Y0Ojk2RERGOjI0MDA3NjY6MkQ5N0M5MDo2QjAxN0M2RCIsInZpc2l0b3JfaWQiOiIzMjAzMTU0MTc5ODU0MDA3NDA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca9239c5a117f3325bbd48f57c8292f54aad992b96dfabde9b73de4ce76a7c7c3
hovercard-subject-tagpull_request:4344125504
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/4458/files
twitter:imagehttps://avatars.githubusercontent.com/u/1391805?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1391805?s=400&v=4
og:image:altOneOf input objects can be defined in a way that makes it impossible to create a value for that type. This breaks the spec's unwritten requirement that all input types be inhabited. The simples...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/graphql-java/graphql-java/pull/4458/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fpull%2F4458%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fpull%2F4458%2Ffiles
Sign uphttps://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/4458/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/4458/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/4458/files
graphql-javahttps://github.com/graphql-java
graphql-javahttps://github.com/graphql-java/graphql-java
Codehttps://github.com/graphql-java/graphql-java
Issues27 (27)https://github.com/graphql-java/graphql-java/issues
Pull requests35 (35)https://github.com/graphql-java/graphql-java/pulls
Discussionshttps://github.com/graphql-java/graphql-java/discussions
Actionshttps://github.com/graphql-java/graphql-java/actions
Projectshttps://github.com/graphql-java/graphql-java/projects
Wikihttps://github.com/graphql-java/graphql-java/wiki
Security and qualityhttps://github.com/graphql-java/graphql-java/security
Insightshttps://github.com/graphql-java/graphql-java/insights
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
jbellengerhttps://github.com/jbellenger
graphql-java:masterhttps://github.com/graphql-java/graphql-java/tree/master
jbellenger:jbellenger-oneof-inhabitability-2https://github.com/jbellenger/graphql-java/tree/jbellenger-oneof-inhabitability-2
Conversation 1 https://github.com/graphql-java/graphql-java/pull/4458
Commits 4 https://github.com/graphql-java/graphql-java/pull/4458/commits
Checks 10 https://github.com/graphql-java/graphql-java/pull/4458/checks
Files changed https://github.com/graphql-java/graphql-java/pull/4458/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4458/files
OneOf inhabitability fixes https://github.com/graphql-java/graphql-java/pull/4458/files#top
Show all changes 4 commits https://github.com/graphql-java/graphql-java/pull/4458/files
3d02d42 checkpoint jbellenger Apr 8, 2026 https://github.com/graphql-java/graphql-java/pull/4458/commits/3d02d42a44c728422000ee25cb1139dff3d39c74
47ef3e5 Merge remote-tracking branch 'upstream/master' into jbellenger-oneof-… jbellenger Aug 22, 2026 https://github.com/graphql-java/graphql-java/pull/4458/commits/47ef3e5d0eb57ae846ddbe6d68c0e7806e5db564
2de6a55 Align input object cycle detection with graphql-js jbellenger Aug 22, 2026 https://github.com/graphql-java/graphql-java/pull/4458/commits/2de6a558e58dbf1624519b274899d2eaad298a7c
b616984 Add input object cycle validation benchmarks jbellenger Aug 23, 2026 https://github.com/graphql-java/graphql-java/pull/4458/commits/b616984d4aac17cf44fb0d27c8c57b0a88c3759c
Clear filters https://github.com/graphql-java/graphql-java/pull/4458/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4458/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4458/files
InputObjectHasUnbreakableCycleBenchmark.java https://github.com/graphql-java/graphql-java/pull/4458/files#diff-48e9e1044a71d688077ffa9f8ac1c3fde5b66360a016b808a7f750e8668a46c1
InputObjectHasUnbreakableCycle.java https://github.com/graphql-java/graphql-java/pull/4458/files#diff-8f304b401e8b549946938e3a6306427b978af61af2b5de39c1fc258b68e3821e
NoUnbrokenInputCycles.java https://github.com/graphql-java/graphql-java/pull/4458/files#diff-1279d58384cd877b6af6475146078d293ba351252c2884b4c0688e3fca3e7b63
OneOfInputObjectRules.java https://github.com/graphql-java/graphql-java/pull/4458/files#diff-1054a5fe3d39926e85101f3083311046b9f87a32071cbdf50869cbfaac178df4
SchemaValidationErrorType.java https://github.com/graphql-java/graphql-java/pull/4458/files#diff-e015b8eb00c7046bc43599f58d9919c119cf35d33f2177e18d608fd1bb9ab4f8
SchemaValidator.java https://github.com/graphql-java/graphql-java/pull/4458/files#diff-c61128ed45b5042860e141f937a41901bfd98ce1561c282107e8f51c7d762035
InputObjectHasUnbreakableCycleTest.groovy https://github.com/graphql-java/graphql-java/pull/4458/files#diff-76435ada6473a9ed4f94c1fc81ca500715df34c17600004811204254cc32a1ba
NoUnbrokenInputCyclesTest.groovy https://github.com/graphql-java/graphql-java/pull/4458/files#diff-ac8960143a42a0f615e3a782f3246cf1e3567d793cf97215393a9c462ac07bde
OneOfInputObjectRulesTest.groovy https://github.com/graphql-java/graphql-java/pull/4458/files#diff-73a57b8d707e6307bb5c76418aa9e107fb960fc5932481f73cb5e9a6d3a37bea
SchemaValidatorTest.groovy https://github.com/graphql-java/graphql-java/pull/4458/files#diff-05d8104f949be383f380a7f78a265bda004f807396548ff874d6b2337376db70
finiteValuePropagation.graphqls https://github.com/graphql-java/graphql-java/pull/4458/files#diff-d1779bce62eeefa2dc5c3899a2ce4192c833be963eb7e63fa91841dd23a71c98
tenTypeMixedInputCycle.graphqls https://github.com/graphql-java/graphql-java/pull/4458/files#diff-d975615496155f2599f240ece3b53879c76a9f5e3858c3a53f79b2630400da8c
tenTypeTenFieldsInputCycle.graphqls https://github.com/graphql-java/graphql-java/pull/4458/files#diff-bf6faeb3684621d59febcf9fa892a47882c99ee05c48e3e8a6b6dde1bad608ac
twoTypeMixedInputCycle.graphqls https://github.com/graphql-java/graphql-java/pull/4458/files#diff-4b8ab72d04debb6aa64828bb1396c26de8f5d783aba735dc905cbe54724cf573
src/jmh/java/benchmark/InputObjectHasUnbreakableCycleBenchmark.javahttps://github.com/graphql-java/graphql-java/pull/4458/files#diff-48e9e1044a71d688077ffa9f8ac1c3fde5b66360a016b808a7f750e8668a46c1
View file https://github.com/graphql-java/graphql-java/blob/b616984d4aac17cf44fb0d27c8c57b0a88c3759c/src/jmh/java/benchmark/InputObjectHasUnbreakableCycleBenchmark.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/4458/{{ revealButtonHref }}
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4458/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4458/files
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.