Title: Is the data loader's per-key context allowed to be null? · Issue #76 · graphql-java/java-dataloader · GitHub
Open Graph Title: Is the data loader's per-key context allowed to be null? · Issue #76 · graphql-java/java-dataloader
X Title: Is the data loader's per-key context allowed to be null? · Issue #76 · graphql-java/java-dataloader
Description: Based on looking at the code and testing it, it appears that this data fetcher will pass through the key context to the data loader, even if it's null: TypeRuntimeWiring.newTypeWiring("Query") .dataFetcher( "myField", environment -> { St...
Open Graph Description: Based on looking at the code and testing it, it appears that this data fetcher will pass through the key context to the data loader, even if it's null: TypeRuntimeWiring.newTypeWiring("Query") .dat...
X Description: Based on looking at the code and testing it, it appears that this data fetcher will pass through the key context to the data loader, even if it's null: TypeRuntimeWiring.newTypeWiring("Que...
Opengraph URL: https://github.com/graphql-java/java-dataloader/issues/76
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Is the data loader's per-key context allowed to be null?","articleBody":"Based on looking at the code and testing it, it _appears_ that this data fetcher will pass through the key context to the data loader, _even if it's null_:\r\n\r\n```\r\n TypeRuntimeWiring.newTypeWiring(\"Query\")\r\n .dataFetcher(\r\n \"myField\",\r\n environment -\u003e {\r\n String myId = environment.getArgument(\"myId\");\r\n \r\n // it's OK if this is null, because the keyContext is allowed to be null?\r\n Integer myKeyContext = getNullableKeyContext(...);\r\n\r\n return environment.getDataLoader(\"myLoader\").load(myId, myKeyContext);\r\n })\r\n .build();\r\n```\r\n\r\nCan you confirm, that though? Because nothing I found in the Javadocs or https://www.graphql-java.com/documentation/v16/batching#passing-context-to-your-data-loader says whether the per-key context is allowed to be `null`.","author":{"url":"https://github.com/skingsland","@type":"Person","name":"skingsland"},"datePublished":"2021-01-15T18:19:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/76/java-dataloader/issues/76"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:38dddc16-0801-669b-e062-4caa2e2b06d5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF6A:54A4E:2CA27F:3F0664:696F9A57 |
| html-safe-nonce | 363cbbe04f706907269f20836330dfab7e4f5d1c5407430987b79aaa02efcf27 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjZBOjU0QTRFOjJDQTI3RjozRjA2NjQ6Njk2RjlBNTciLCJ2aXNpdG9yX2lkIjoiNDE2OTYzNzExOTgyNDczMDcxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 59df1f736047e4e93ad79af89a5cecac5c89bda7cb10472c46dec522cf1d1150 |
| hovercard-subject-tag | issue:787099474 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/graphql-java/java-dataloader/76/issue_layout |
| twitter:image | https://opengraph.githubassets.com/663752bff761f107049683054fe52400f32c5f588655ea7ee5c2a725eb880379/graphql-java/java-dataloader/issues/76 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/663752bff761f107049683054fe52400f32c5f588655ea7ee5c2a725eb880379/graphql-java/java-dataloader/issues/76 |
| og:image:alt | Based on looking at the code and testing it, it appears that this data fetcher will pass through the key context to the data loader, even if it's null: TypeRuntimeWiring.newTypeWiring("Query") .dat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skingsland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0ca8d8c65612640b9a1a588b3eed68222ca723ed2d028b18fe81b28936d535eb |
| turbo-cache-control | no-preview |
| go-import | github.com/graphql-java/java-dataloader git https://github.com/graphql-java/java-dataloader.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 97364654 |
| octolytics-dimension-repository_nwo | graphql-java/java-dataloader |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 97364654 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/java-dataloader |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 95f60616ce2765d1114fe6da4af405a58c6d26d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width