Title: Is the data loader's per-key context allowed to be null? · graphql-java/java-dataloader · Discussion #94 · GitHub
Open Graph Title: Is the data loader's per-key context allowed to be null? · graphql-java/java-dataloader · Discussion #94
X Title: Is the data loader's per-key context allowed to be null? · graphql-java/java-dataloader · Discussion #94
Description: Is the data loader's per-key context allowed to be null?
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/discussions/94
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Is the data loader's per-key context allowed to be null?","text":"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:
\n TypeRuntimeWiring.newTypeWiring(\"Query\")\n .dataFetcher(\n \"myField\",\n environment -> {\n String myId = environment.getArgument(\"myId\");\n \n // it's OK if this is null, because the keyContext is allowed to be null?\n Integer myKeyContext = getNullableKeyContext(...);\n\n return environment.getDataLoader(\"myLoader\").load(myId, myKeyContext);\n })\n .build();\n
\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.
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes they can be null
","upvoteCount":2,"url":"https://github.com/graphql-java/java-dataloader/discussions/94#discussioncomment-1094039"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:69888fdc-1263-63be-2a4b-71f2e8c2bff5 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | E928:3EFC3A:3736A4:4CEF8D:696F800C |
| html-safe-nonce | 84cbea271982cf096266bebcb0915edf5ee310b1a8d68e656eef647f7b78b653 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTI4OjNFRkMzQTozNzM2QTQ6NENFRjhEOjY5NkY4MDBDIiwidmlzaXRvcl9pZCI6IjQ0NzM5OTMwMjM3MDM3MTE3NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fdddd9e217d4c6774ddaed075925a6cafb30fcbeddf7f0af66c67a839dafe3fc |
| hovercard-subject-tag | discussion:3491827 |
| github-keyboard-shortcuts | repository,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/Voltron::DiscussionsFragmentsController/show/graphql-java/java-dataloader/94/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/07196a15572d3655c2523b16504cc16fcbfa3dd1ca74f3bfe17721b91275b01a/graphql-java/java-dataloader/discussions/94 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07196a15572d3655c2523b16504cc16fcbfa3dd1ca74f3bfe17721b91275b01a/graphql-java/java-dataloader/discussions/94 |
| 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 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 759c36b32159cc867ba926786bbd5ac69b0804c9cfc86536a67b3567e8bbbb5c |
| 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 | 08632b85cc9aa97742e56978eb25cc43ca37e51b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width