René's URL Explorer Experiment


Title: Question: Field selection and error handling in a batch loader? · Issue #53 · graphql-java/java-dataloader · GitHub

Open Graph Title: Question: Field selection and error handling in a batch loader? · Issue #53 · graphql-java/java-dataloader

X Title: Question: Field selection and error handling in a batch loader? · Issue #53 · graphql-java/java-dataloader

Description: I have two unrelated questions: 1. Error handling Neither org.dataloader.BatchLoader::load nor org.dataloader.BatchLoaderWithContext::load allow one to throw an exception while attempting to fetch some data from some source, because the ...

Open Graph Description: I have two unrelated questions: 1. Error handling Neither org.dataloader.BatchLoader::load nor org.dataloader.BatchLoaderWithContext::load allow one to throw an exception while attempting to fetch ...

X Description: I have two unrelated questions: 1. Error handling Neither org.dataloader.BatchLoader::load nor org.dataloader.BatchLoaderWithContext::load allow one to throw an exception while attempting to fetch ...

Opengraph URL: https://github.com/graphql-java/java-dataloader/issues/53

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Question: Field selection and error handling in a batch loader?","articleBody":"I have two unrelated questions:\r\n\r\n### 1. Error handling\r\n\r\nNeither `org.dataloader.BatchLoader::load` nor `org.dataloader.BatchLoaderWithContext::load` allow one to throw an exception while attempting to fetch some data from some source, because the interface does not declare that an exception is thrown:\r\n\r\n```java\r\n    CompletionStage\u003cList\u003cV\u003e\u003e load(List\u003cK\u003e keys);\r\n```\r\n\r\nWhat is the correct way to handle an error, when, for example, my repository blows up while trying to load a list of entities by the provided keys? Similarly, what if some external HTTP request to fetch a list of entities fails in an unrecoverable way? It seems wrong in these cases to return an empty list; I would prefer to throw an exception and cause the entire GraphQL call stack to unwind instead of returning partial data.\r\n\r\n### 2. Field selection\r\n\r\nThe `BatchLoaderEnvironment` passed to a `BatchLoaderWithContext::load` call does not allow me to inspect the request for the selected fields that caused loading of some entities to occur. Is there a way to do this? I prefer to select only the columns absolutely necessary from the database/API/etc. to optimize performance.\r\n\r\nI can imagine that it may be difficult to traverse all nodes on the query to aggregate the minimum acceptable selection of fields from a given type, but it doesn't seem impossible. What I'm hoping is possible is something like this:\r\n\r\nGiven a query like this:\r\n```\r\nquery {\r\n  foo {\r\n    bar {\r\n      fieldA\r\n      fieldB\r\n      fieldC\r\n    }\r\n  }\r\n  bar {\r\n    fieldA\r\n    fieldD\r\n  }\r\n}\r\n```\r\n\r\n...that I can be able to then only select fields A, B, C, and D, instead of a `SELECT *` (assuming a relational database is the backing store).\r\n\r\nThanks for your help!","author":{"url":"https://github.com/timrourke","@type":"Person","name":"timrourke"},"datePublished":"2019-09-23T22:26:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/53/java-dataloader/issues/53"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cdbdf65e-ccb1-4cf7-cd81-b1a1e3b8d7fa
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id86DC:287443:AB6040:E49C54:69701726
html-safe-nonceef5442608573cf5c1dd37d7cfa6f86065f7aad89d150af8614ffe2146e8bacd5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkRDOjI4NzQ0MzpBQjYwNDA6RTQ5QzU0OjY5NzAxNzI2IiwidmlzaXRvcl9pZCI6IjM5NDE4ODQ4MzEwMDMwNTU5MTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac79c280a4b933159d999683082c63cb82f84c121280dfa9e5e914060e7699d376
hovercard-subject-tagissue:497359119
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/graphql-java/java-dataloader/53/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f6626571881f41233a112936dde17fd5bb64930b7fd7ff233d4fb0804fce99c5/graphql-java/java-dataloader/issues/53
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f6626571881f41233a112936dde17fd5bb64930b7fd7ff233d4fb0804fce99c5/graphql-java/java-dataloader/issues/53
og:image:altI have two unrelated questions: 1. Error handling Neither org.dataloader.BatchLoader::load nor org.dataloader.BatchLoaderWithContext::load allow one to throw an exception while attempting to fetch ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametimrourke
hostnamegithub.com
expected-hostnamegithub.com
None043a09521e81f00c45482046b3f38390b8b292cf9a86ad665a632633a072c05c
turbo-cache-controlno-preview
go-importgithub.com/graphql-java/java-dataloader git https://github.com/graphql-java/java-dataloader.git
octolytics-dimension-user_id14289921
octolytics-dimension-user_logingraphql-java
octolytics-dimension-repository_id97364654
octolytics-dimension-repository_nwographql-java/java-dataloader
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id97364654
octolytics-dimension-repository_network_root_nwographql-java/java-dataloader
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release98881eadf8ae73000970c42161c094b0809b1330
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues/53#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fjava-dataloader%2Fissues%2F53
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fjava-dataloader%2Fissues%2F53
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=graphql-java%2Fjava-dataloader
Reloadhttps://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues/53
Reloadhttps://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues/53
Reloadhttps://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues/53
graphql-java https://patch-diff.githubusercontent.com/graphql-java
java-dataloaderhttps://patch-diff.githubusercontent.com/graphql-java/java-dataloader
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fgraphql-java%2Fjava-dataloader
Fork 95 https://patch-diff.githubusercontent.com/login?return_to=%2Fgraphql-java%2Fjava-dataloader
Star 520 https://patch-diff.githubusercontent.com/login?return_to=%2Fgraphql-java%2Fjava-dataloader
Code https://patch-diff.githubusercontent.com/graphql-java/java-dataloader
Issues 1 https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues
Pull requests 10 https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/pulls
Discussions https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/discussions
Actions https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/actions
Projects 0 https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/projects
Wiki https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/security
Please reload this pagehttps://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues/53
Insights https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/pulse
Code https://patch-diff.githubusercontent.com/graphql-java/java-dataloader
Issues https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues
Pull requests https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/pulls
Discussions https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/discussions
Actions https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/actions
Projects https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/projects
Wiki https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/wiki
Security https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/security
Insights https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/graphql-java/java-dataloader/issues/53
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/graphql-java/java-dataloader/issues/53
Question: Field selection and error handling in a batch loader?https://patch-diff.githubusercontent.com/graphql-java/java-dataloader/issues/53#top
https://github.com/timrourke
https://github.com/timrourke
timrourkehttps://github.com/timrourke
on Sep 23, 2019https://github.com/graphql-java/java-dataloader/issues/53#issue-497359119
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.