Title: ClassCastException when walking over input types that have GraphQLTypeReferences · Issue #99 · graphql-java/graphql-java-extended-validation · GitHub
Open Graph Title: ClassCastException when walking over input types that have GraphQLTypeReferences · Issue #99 · graphql-java/graphql-java-extended-validation
X Title: ClassCastException when walking over input types that have GraphQLTypeReferences · Issue #99 · graphql-java/graphql-java-extended-validation
Description: Describe the bug java.lang.ClassCastException: class graphql.schema.GraphQLTypeReference cannot be cast to class graphql.schema.GraphQLUnmodifiedType (graphql.schema.GraphQLTypeReference and graphql.schema.GraphQLUnmodifiedType are in un...
Open Graph Description: Describe the bug java.lang.ClassCastException: class graphql.schema.GraphQLTypeReference cannot be cast to class graphql.schema.GraphQLUnmodifiedType (graphql.schema.GraphQLTypeReference and graphq...
X Description: Describe the bug java.lang.ClassCastException: class graphql.schema.GraphQLTypeReference cannot be cast to class graphql.schema.GraphQLUnmodifiedType (graphql.schema.GraphQLTypeReference and graphq...
Opengraph URL: https://github.com/graphql-java/graphql-java-extended-validation/issues/99
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ClassCastException when walking over input types that have GraphQLTypeReferences","articleBody":"**Describe the bug**\r\n```\r\njava.lang.ClassCastException: class graphql.schema.GraphQLTypeReference cannot be cast to class graphql.schema.GraphQLUnmodifiedType (graphql.schema.GraphQLTypeReference and graphql.schema.GraphQLUnmodifiedType are in unnamed module of loader 'app')\r\n at graphql.schema.GraphQLTypeUtil.unwrapAll(GraphQLTypeUtil.java:194)\r\n at graphql.validation.util.DirectivesAndTypeWalker.walkInputType(DirectivesAndTypeWalker.java:23)\r\n at graphql.validation.util.DirectivesAndTypeWalker.isSuitable(DirectivesAndTypeWalker.java:19)\r\n```\r\n\r\n**To Reproduce** \r\nI have an enum type that is used as non-null input\r\n```\r\nenum SlotType {\r\n AVAILABLE, UNAVAILABLE\r\n}\r\n\r\ntype Employee {\r\n schedule(type: SlotType!): [Slot!]!\r\n}\r\n```\r\n\r\n`DirectivesAndTypeWalker` uses `GraphQLTypeUtil.unwrapAll(inputType)` since https://github.com/graphql-java/graphql-java-extended-validation/pull/34 but `unwrapAll` specifically says that it does not support `GraphQLTypeReference`:\r\n```\r\nUnwraps all layers of the type or just returns the type again if it's not a wrapped type NOTE: This method does not support GraphQLTypeReference as input and will lead to a ClassCastException\r\n```\r\n\r\nand `SlotType` turns out to be one:\r\n```\r\ntype = {GraphQLNonNull@17904} \"SlotType!\"\r\n originalWrappedType = {GraphQLTypeReference@17955} \"GraphQLTypeReference{name='SlotType'}\"\r\n name = \"SlotType\"\r\n replacedWrappedType = null\r\n```\r\n","author":{"url":"https://github.com/edudar-chwy","@type":"Person","name":"edudar-chwy"},"datePublished":"2024-10-29T19:21:33Z","url":"https://github.com/graphql-java/graphql-java-extended-validation/issues/99"}
| 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/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e0a62d3-0163-c3ba-853c-fd2148291ec9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C630:313081:166E5B:1DFDD9:6B018669 |
| html-safe-nonce | 9ecf0ab0256550a88a8559daf9cbdfc13ce275a5965925852e3fd23b07c332ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjMwOjMxMzA4MToxNjZFNUI6MURGREQ5OjZCMDE4NjY5IiwidmlzaXRvcl9pZCI6Ijg1MDUxNTcwNjc1NjMxNzM0ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f92c895c7c1df2dd9502c499d129f26792c1b3803c63757b54a44393c7d8b820 |
| hovercard-subject-tag | issue:2622129072 |
| 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-extended-validation/99/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74e0bfb02e0884a689ac15ba83f792c743cff5599a07b67294980ceb1cfc229a/graphql-java/graphql-java-extended-validation/issues/99 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74e0bfb02e0884a689ac15ba83f792c743cff5599a07b67294980ceb1cfc229a/graphql-java/graphql-java-extended-validation/issues/99 |
| og:image:alt | Describe the bug java.lang.ClassCastException: class graphql.schema.GraphQLTypeReference cannot be cast to class graphql.schema.GraphQLUnmodifiedType (graphql.schema.GraphQLTypeReference and graphq... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | edudar-chwy |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/graphql-java/graphql-java-extended-validation git https://github.com/graphql-java/graphql-java-extended-validation.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 205507809 |
| octolytics-dimension-repository_nwo | graphql-java/graphql-java-extended-validation |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205507809 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/graphql-java-extended-validation |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width