René's URL Explorer Experiment


Title: DataFetchingFieldSelectionSet ignores inline fragments when parent type is interface/union by tinnou · Pull Request #1952 · graphql-java/graphql-java · GitHub

Open Graph Title: DataFetchingFieldSelectionSet ignores inline fragments when parent type is interface/union by tinnou · Pull Request #1952 · graphql-java/graphql-java

X Title: DataFetchingFieldSelectionSet ignores inline fragments when parent type is interface/union by tinnou · Pull Request #1952 · graphql-java/graphql-java

Description: [DO NOT MERGE] Description This PR is more of a question than a PR, the code changes consist of a single unit test to reproduce the use case. Say I have the following shortened SWAPI schema: type QueryType { humanCharacter(id : String) : Character } interface Character { id: ID! } type Human implements Character { id: ID! homePlanet: String } and the following query: { humanCharacter(id: "1003") { --> returns Leia who is a Human id __typename ... on Human { homePlanet } } } The selection set returned by environment.getSelectionSet().get().keySet() when ran from the Query.humanCharacter data fetcher contains all the fields but homePlanet. That is: ["id", "__typename"] I would like to understand if this omission is by design or it is a defect. If it is by design: We are returning only the fields in the selection set which we are sure are of the same type as the field output type. In our example, we would only return the fields from the selection set that are on the type Character. Assuming it is by design, does it kind of defeats the purpose of looking ahead? If say, we were making a request to a SQL system (as per the doc) using the DataDetchingSelectionSet fields as projection. Since we only get back the selected fields on Character, i.e id and __typename, wouldn't this create a hurdle as homePlanet would be missing from the SQL statement? If it is a defect I can update the PR to include fragments in the selection set. The test added in this PR fails because it expected homePlanet to be included: Condition not satisfied: captureMap.keySet() == [ "id", "__typename", "friends", "friends/id", "friends/otherId", "otherId", "homePlanet" ].toSet() | | | | | | false [otherId, __typename, id, friends/otherId, friends/id, homePlanet, friends] | [otherId, __typename, id, friends/otherId, friends/id, friends] [otherId:otherId: id, __typename:__typename, id:id, friends/otherId:otherId: id, friends/id:id, friends:friends { id otherId: id }]

Open Graph Description: [DO NOT MERGE] Description This PR is more of a question than a PR, the code changes consist of a single unit test to reproduce the use case. Say I have the following shortened SWAPI schema: type Q...

X Description: [DO NOT MERGE] Description This PR is more of a question than a PR, the code changes consist of a single unit test to reproduce the use case. Say I have the following shortened SWAPI schema: type Q...

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

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:8276696e-9646-5ac1-932d-b552d2a7babe
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDD14:1AE20C:2854E87:33071DB:6B019663
html-safe-nonce89835fd8fafe393a129a91109ede23c3422ae939674dbd2e377a635e56976fe7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDE0OjFBRTIwQzoyODU0RTg3OjMzMDcxREI6NkIwMTk2NjMiLCJ2aXNpdG9yX2lkIjoiNDYyODE2OTI0MTQxNjI3NTU1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb7d1b4c5c82d1577905a8e351720ce6054aa35f88f80112bba6e5a69c7f291f7
hovercard-subject-tagpull_request:432111343
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/1952/files
twitter:imagehttps://avatars.githubusercontent.com/u/1523863?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1523863?s=400&v=4
og:image:alt[DO NOT MERGE] Description This PR is more of a question than a PR, the code changes consist of a single unit test to reproduce the use case. Say I have the following shortened SWAPI schema: type Q...
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/1952/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fpull%2F1952%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%2F1952%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/1952/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/1952/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/1952/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
tinnouhttps://github.com/tinnou
graphql-java:masterhttps://github.com/graphql-java/graphql-java/tree/master
tinnou:selection-set-inline-fragment-with-interface-typehttps://github.com/tinnou/graphql-java/tree/selection-set-inline-fragment-with-interface-type
Conversation 7 https://github.com/graphql-java/graphql-java/pull/1952
Commits 1 https://github.com/graphql-java/graphql-java/pull/1952/commits
Checks 0 https://github.com/graphql-java/graphql-java/pull/1952/checks
Files changed https://github.com/graphql-java/graphql-java/pull/1952/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/1952/files
DataFetchingFieldSelectionSet ignores inline fragments when parent type is interface/union https://github.com/graphql-java/graphql-java/pull/1952/files#top
Show all changes 1 commit https://github.com/graphql-java/graphql-java/pull/1952/files
d1a3974 DataFetchingSelectionSet ignores inline fragments when parent type is… tinnou Jun 9, 2020 https://github.com/graphql-java/graphql-java/pull/1952/commits/d1a3974b22774e5b3e192d9c830badaae96657f3
Clear filters https://github.com/graphql-java/graphql-java/pull/1952/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/1952/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/1952/files
StarWarsData.groovy https://github.com/graphql-java/graphql-java/pull/1952/files#diff-b2ce7bd105a253755d3b4c5bb7dc15e445bb6e1a205882d1c0228aa72ebaa490
DataFetcherSelectionTest.groovy https://github.com/graphql-java/graphql-java/pull/1952/files#diff-17bbb50e1bdb6a1be4adbffb2555b1d318db0cb78dc7b4a4b27972f80d7d8161
starWarsSchemaWithArguments.graphqls https://github.com/graphql-java/graphql-java/pull/1952/files#diff-010a64df00ad611e5dc65989b6c4176e3c5c85e5047c5ace81cf68f91994dfba
src/test/groovy/graphql/StarWarsData.groovyhttps://github.com/graphql-java/graphql-java/pull/1952/files#diff-b2ce7bd105a253755d3b4c5bb7dc15e445bb6e1a205882d1c0228aa72ebaa490
View file https://github.com/tinnou/graphql-java/blob/d1a3974b22774e5b3e192d9c830badaae96657f3/src/test/groovy/graphql/StarWarsData.groovy
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/1952/{{ revealButtonHref }}
https://github.com/graphql-java/graphql-java/pull/1952/files#diff-b2ce7bd105a253755d3b4c5bb7dc15e445bb6e1a205882d1c0228aa72ebaa490
https://github.com/graphql-java/graphql-java/pull/1952/files#diff-b2ce7bd105a253755d3b4c5bb7dc15e445bb6e1a205882d1c0228aa72ebaa490
src/test/groovy/graphql/schema/DataFetcherSelectionTest.groovyhttps://github.com/graphql-java/graphql-java/pull/1952/files#diff-17bbb50e1bdb6a1be4adbffb2555b1d318db0cb78dc7b4a4b27972f80d7d8161
View file https://github.com/tinnou/graphql-java/blob/d1a3974b22774e5b3e192d9c830badaae96657f3/src/test/groovy/graphql/schema/DataFetcherSelectionTest.groovy
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/1952/{{ revealButtonHref }}
https://github.com/graphql-java/graphql-java/pull/1952/files#diff-17bbb50e1bdb6a1be4adbffb2555b1d318db0cb78dc7b4a4b27972f80d7d8161
https://github.com/graphql-java/graphql-java/pull/1952/files#diff-17bbb50e1bdb6a1be4adbffb2555b1d318db0cb78dc7b4a4b27972f80d7d8161
https://github.com/graphql-java/graphql-java/pull/1952/files#diff-17bbb50e1bdb6a1be4adbffb2555b1d318db0cb78dc7b4a4b27972f80d7d8161
src/test/resources/starWarsSchemaWithArguments.graphqlshttps://github.com/graphql-java/graphql-java/pull/1952/files#diff-010a64df00ad611e5dc65989b6c4176e3c5c85e5047c5ace81cf68f91994dfba
View file https://github.com/tinnou/graphql-java/blob/d1a3974b22774e5b3e192d9c830badaae96657f3/src/test/resources/starWarsSchemaWithArguments.graphqls
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/1952/{{ revealButtonHref }}
https://github.com/graphql-java/graphql-java/pull/1952/files#diff-010a64df00ad611e5dc65989b6c4176e3c5c85e5047c5ace81cf68f91994dfba
https://github.com/graphql-java/graphql-java/pull/1952/files#diff-010a64df00ad611e5dc65989b6c4176e3c5c85e5047c5ace81cf68f91994dfba
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.