Title: Dependency graph design · Issue #1566 · graphql-java/graphql-java · GitHub
Open Graph Title: Dependency graph design · Issue #1566 · graphql-java/graphql-java
X Title: Dependency graph design · Issue #1566 · graphql-java/graphql-java
Description: I want to capture here some thoughts about the Dependency graph (see #1409). One of the main challenges is the dynamic aspects of a query (type conditions). For exampel for this schema: type Query{ node: Node } interface Animal { name: S...
Open Graph Description: I want to capture here some thoughts about the Dependency graph (see #1409). One of the main challenges is the dynamic aspects of a query (type conditions). For exampel for this schema: type Query{...
X Description: I want to capture here some thoughts about the Dependency graph (see #1409). One of the main challenges is the dynamic aspects of a query (type conditions). For exampel for this schema: type Query{...
Opengraph URL: https://github.com/graphql-java/graphql-java/issues/1566
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dependency graph design","articleBody":"I want to capture here some thoughts about the Dependency graph (see #1409).\r\n\r\nOne of the main challenges is the dynamic aspects of a query (type conditions). \r\n\r\nFor exampel for this schema:\r\n```graphql\r\ntype Query{ \r\n node: Node\r\n}\r\ninterface Animal {\r\n name: String\r\n friends: [Friend]\r\n}\r\n\r\nunion Pet = Dog | Cat\r\n\r\ntype Friend {\r\n name: String\r\n isBirdOwner: Bool\r\n isCatOwner: Bool\r\n pets: [Pet] \r\n}\r\n\r\ntype Bird implements Animal {\r\n name: String \r\n friends: [Friend]\r\n}\r\n\r\ntype Cat implements Animal{\r\n name: String \r\n friends: [Friend]\r\n breed: CatBreed \r\n}\r\n\r\ntype Dog implements Animal{\r\n name: String \r\n breed: DogBreed\r\n friends: [Friend]\r\n}\r\n\r\nscalar DogBreed\r\nscalar CatBreed\r\n```\r\none can imagine this query:\r\n\r\n```graphql\r\n{\r\n node\r\n ... on Cat {\r\n friends {\r\n isCatOwner\r\n name\r\n pets {\r\n name\r\n ... on Cat {\r\n breed\r\n }\r\n }\r\n }\r\n }\r\n ... on Bird {\r\n name\r\n friends {\r\n isBirdOwner\r\n name\r\n pets {\r\n name\r\n ... on Dog {\r\n breed\r\n }\r\n }\r\n }\r\n }\r\n ... on Dog {\r\n name\r\n }\r\n}\r\n\r\n```\r\n\r\nThe question is now how the dependency graph should capture these dynamic type conditions. \r\nOne possible way could be this:\r\n\u003cimg width=\"1041\" alt=\"Screen Shot 2019-06-10 at 11 15 36 am\" src=\"https://user-images.githubusercontent.com/1706744/59166846-1c11ba80-8b71-11e9-89cc-bf488405a91b.png\"\u003e\r\n\r\nBut the value of this kind of dependency graph maybe limited because it doesn't uphold to one fundamental expectation that every field is only present once.\r\nThe `/node/friends/pets/name` field is duplicated because it will only be executed if we have a `Bird` or a `Cat`, but not for a `Dog`. \r\n\r\nSame is true for `/node/friends/pets` and `/node/friends/name`.\r\n\r\nThe alternative could maybe look like this:\r\n\u003cimg width=\"890\" alt=\"Screen Shot 2019-06-10 at 11 34 45 am\" src=\"https://user-images.githubusercontent.com/1706744/59167289-cb4f9100-8b73-11e9-86da-3968f5e46639.png\"\u003e\r\n\r\n\r\n\r\nIt doesn't duplicate any fields anymore but now there are complex conditions associated with some nodes. For example `/node/friends/pets/breed` will only be evaluated if the original node is a `Cat` and the pet is a `Dog`.\r\n\r\n","author":{"url":"https://github.com/andimarek","@type":"Person","name":"andimarek"},"datePublished":"2019-06-10T01:30:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/1566/graphql-java/issues/1566"}
| 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:fae81280-9cec-84f5-2ed6-90fd5894720b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2CE:365392:18468:2213D:696F9E43 |
| html-safe-nonce | 657caf92e383d1557a9109f38353e9020ba6eb8ea82ac04622a0e4338b56edab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkNFOjM2NTM5MjoxODQ2ODoyMjEzRDo2OTZGOUU0MyIsInZpc2l0b3JfaWQiOiI2MDYzMDEyNTQ4MzcwNTA5NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ba3d875f1001b3deeeeb280ce925563651c620d2e2e3304f94ffc69b89511e71 |
| hovercard-subject-tag | issue:453963673 |
| 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/graphql-java/1566/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c775b04a349bf37e3a61b6488ea6ce0a8d6df4c67ef00b66d82506d54161e55/graphql-java/graphql-java/issues/1566 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c775b04a349bf37e3a61b6488ea6ce0a8d6df4c67ef00b66d82506d54161e55/graphql-java/graphql-java/issues/1566 |
| og:image:alt | I want to capture here some thoughts about the Dependency graph (see #1409). One of the main challenges is the dynamic aspects of a query (type conditions). For exampel for this schema: type Query{... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andimarek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0ca8d8c65612640b9a1a588b3eed68222ca723ed2d028b18fe81b28936d535eb |
| 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 | 95f60616ce2765d1114fe6da4af405a58c6d26d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width