Title: How to work around a significant DataFetchingFieldSelectionSet performance issue with many types · graphql-java/graphql-java · Discussion #2309 · GitHub
Open Graph Title: How to work around a significant DataFetchingFieldSelectionSet performance issue with many types · graphql-java/graphql-java · Discussion #2309
X Title: How to work around a significant DataFetchingFieldSelectionSet performance issue with many types · graphql-java/graphql-java · Discussion #2309
Description: How to work around a significant DataFetchingFieldSelectionSet performance issue with many types
Open Graph Description: Hi! I am playing with GraphQL-Java and have had really good progress really fast. Perhaps too fast. I've landed on an issue where DataFetchingFieldSelectionSetImpl.getImmediateFields() is taking 20...
X Description: Hi! I am playing with GraphQL-Java and have had really good progress really fast. Perhaps too fast. I've landed on an issue where DataFetchingFieldSelectionSetImpl.getImmediateFields() is takin...
Opengraph URL: https://github.com/graphql-java/graphql-java/discussions/2309
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"How to work around a significant DataFetchingFieldSelectionSet performance issue with many types","text":"\u003cp dir=\"auto\"\u003eHi! I am playing with GraphQL-Java and have had really good progress really fast. Perhaps too fast.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eI've landed on an issue where \u003ccode class=\"notranslate\"\u003eDataFetchingFieldSelectionSetImpl.getImmediateFields()\u003c/code\u003e is taking 20 seconds to run. I cannot work with that and need help working around the issue. Inspection showed that the result from it had 3.5 million entries in my case for a GraphQL query that looks roughly like this:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"{\n things {\n id\n parent {\n id\n name\n parent {\n id\n name\n parent {\n id\n name\n parent {\n id\n name\n }\n }\n }\n }\n }\n}\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode class=\"notranslate\"\u003e{\n things {\n id\n parent {\n id\n name\n parent {\n id\n name\n parent {\n id\n name\n parent {\n id\n name\n }\n }\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYes, this is \"deep\" but quite a simple query otherwise. My gut feeling about what sets this off is that we have over a hundred various types (interfaces and objects) that any parent can be be of and I haven't found a way to simply ask for \"give me what is stated, don't try to resolve this to per-type fields\" which causes huge repetition - each field is listed many times, one per type it exists in, for all possible types, at each level.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eI cannot change the data model - this is a complex, large application and the types in it exist for good reasons. Dividing this time into smaller chunks wouldn't be helpful either, as it would still be spent, just differently. How can I get what is requested by the client at \"face value\" and no processing/resolving at all?\u003c/p\u003e","upvoteCount":1,"answerCount":12,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eSeems related: \u003ca class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"801463511\" data-permission-text=\"Title is private\" data-url=\"https://github.com/graphql-java/graphql-java/issues/2185\" data-hovercard-type=\"issue\" data-hovercard-url=\"/graphql-java/graphql-java/issues/2185/hovercard\" href=\"https://github.com/graphql-java/graphql-java/issues/2185\"\u003e#2185\u003c/a\u003e\u003c/p\u003e","upvoteCount":1,"url":"https://github.com/graphql-java/graphql-java/discussions/2309#discussioncomment-725917"}}}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:d39d1765-6e0e-8501-b4ee-180140665a65 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | CCDC:EDA7A:28C104F:33C81EE:6B01A0A5 |
| html-safe-nonce | 04b59030daeee8367f03f7f947b6816fd4de01707e2d4a30d1582ada5ab4f262 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0RDOkVEQTdBOjI4QzEwNEY6MzNDODFFRTo2QjAxQTBBNSIsInZpc2l0b3JfaWQiOiIzODQ5NzQ2NzgzMTE4OTI1OTg5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 49d9b27c7f00c54fe68f8b241c3746470e60528df18b7c1498197d87edf44a42 |
| hovercard-subject-tag | discussion:3340662 |
| 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/graphql-java/2309/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/1fb389fde13669aeb3600a9c8f37492d3c49ce151c950006002059b85d36d92b/graphql-java/graphql-java/discussions/2309 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1fb389fde13669aeb3600a9c8f37492d3c49ce151c950006002059b85d36d92b/graphql-java/graphql-java/discussions/2309 |
| og:image:alt | Hi! I am playing with GraphQL-Java and have had really good progress really fast. Perhaps too fast. I've landed on an issue where DataFetchingFieldSelectionSetImpl.getImmediateFields() is taking 20... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 38602457 |
| octolytics-dimension-repository_nwo | graphql-java/graphql-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38602457 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/graphql-java |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width