Title: Edge case with GraphQLTypeReference and Schema Transforms by xuorig · Pull Request #2905 · graphql-java/graphql-java · GitHub
Open Graph Title: Edge case with GraphQLTypeReference and Schema Transforms by xuorig · Pull Request #2905 · graphql-java/graphql-java
X Title: Edge case with GraphQLTypeReference and Schema Transforms by xuorig · Pull Request #2905 · graphql-java/graphql-java
Description: 👋 Hello I've hit a pretty interesting edge case with GraphQLSchema#transform. We use it to do some schema filtering and noticed a failure when combined with recursive types using GraphQLTypeReference. When a part of the schema holding the "true" reference to a GraphQL object type is removed, if there are GraphQLTypeReferences remaining in the rest of the schema, they won't be able to be resolved. The original type won't be in the type map anymore because the new type map is regenerated from the trasnformed schema tree (https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/schema/GraphQLSchema.java#L916) I've included a test that reproduces the issue. It's possible to mitigate the issue by re-injecting those types through additionalTypes, but I'd like your thoughts if this would deserve handling at the graphql-java level, or you think it's best left to the user to avoid / mitigate the issue from happening. Happy to contribute a fix if this is worthwhile, but feel free to close if this is a no-fix.
Open Graph Description: 👋 Hello I've hit a pretty interesting edge case with GraphQLSchema#transform. We use it to do some schema filtering and noticed a failure when combined with recursive types using GraphQLTypeRef...
X Description: 👋 Hello I've hit a pretty interesting edge case with GraphQLSchema#transform. We use it to do some schema filtering and noticed a failure when combined with recursive types using GraphQLTyp...
Opengraph URL: https://github.com/graphql-java/graphql-java/pull/2905
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2dab947c-75af-66d8-13f9-0fba92494de3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B530:37F8F:7E90A0:AF2185:6A604007 |
| html-safe-nonce | 9da65bf58be1b85e952c458153b2c70927d559341afb110a30311e6e91725906 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTMwOjM3RjhGOjdFOTBBMDpBRjIxODU6NkE2MDQwMDciLCJ2aXNpdG9yX2lkIjoiNzI4NDE4ODA2ODIwMjk1NDc1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 75fac8512f5ed3b809b0db440e7d4a29f3eba6040b1bcff2531da2a44178a29e |
| hovercard-subject-tag | pull_request:1012370303 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/graphql-java/graphql-java/pull/2905/files |
| twitter:image | https://avatars.githubusercontent.com/u/1919498?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1919498?s=400&v=4 |
| og:image:alt | 👋 Hello I've hit a pretty interesting edge case with GraphQLSchema#transform. We use it to do some schema filtering and noticed a failure when combined with recursive types using GraphQLTypeRef... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60da8c2a42fa2bbf5f7567474990ec467836a84444262a58e200fa91b7f3d2d0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9824515e740d83d5eb82168a089b806ab0fe04a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width