Title: Variables are coerced twice during an execution when a field validation instrumentation is active · Issue #2458 · graphql-java/graphql-java · GitHub
Open Graph Title: Variables are coerced twice during an execution when a field validation instrumentation is active · Issue #2458 · graphql-java/graphql-java
X Title: Variables are coerced twice during an execution when a field validation instrumentation is active · Issue #2458 · graphql-java/graphql-java
Description: Describe the bug It looks like variables are coerced twice during an execution using graphql-java 16.2, once in execute and once in validateFieldsAndArguments. This breaks e.g. enums with non-default names. Variables are first coerced he...
Open Graph Description: Describe the bug It looks like variables are coerced twice during an execution using graphql-java 16.2, once in execute and once in validateFieldsAndArguments. This breaks e.g. enums with non-defau...
X Description: Describe the bug It looks like variables are coerced twice during an execution using graphql-java 16.2, once in execute and once in validateFieldsAndArguments. This breaks e.g. enums with non-defau...
Opengraph URL: https://github.com/graphql-java/graphql-java/issues/2458
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Variables are coerced twice during an execution when a field validation instrumentation is active","articleBody":"**Describe the bug**\r\nIt looks like variables are coerced twice during an execution using graphql-java 16.2, once in `execute` and once in `validateFieldsAndArguments`. This breaks e.g. enums with non-default names.\r\n\r\nVariables are first coerced [here](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/execution/Execution.java#L69), then [added to the execution context](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/execution/Execution.java#L90).\r\nIn `FieldValidationSupport`, the `QueryTraverser` is [initialized with those variables from the execution context](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/execution/instrumentation/fieldvalidation/FieldValidationSupport.java#L36) and coerces them again [here](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/analysis/QueryTraverser.java#L60).\r\n\r\n**To Reproduce**\r\nIf you have an enum value defined like this\r\n```kotlin\r\nGraphQLEnumType.newEnum()\r\n .name(\"MyEnum\")\r\n .description(\"My enum with all lowercase names.\")\r\n .values(\r\n MyEnum.values().map {\r\n GraphQLEnumValueDefinition.newEnumValueDefinition()\r\n .name(it.getLowerCaseName())\r\n .value(it)\r\n .build()\r\n }\r\n ).build()\r\n```\r\nthe first coercion works correctly, but the second one fails.","author":{"url":"https://github.com/jenssuhr","@type":"Person","name":"jenssuhr"},"datePublished":"2021-07-14T12:19:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/2458/graphql-java/issues/2458"}
| 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:2cb6473e-85ff-1025-01f0-3e41519181ec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0BE:2046A1:4CF621:6EEF95:6A6208D9 |
| html-safe-nonce | ea89db2fa371023b2fa3f2afa47dbecd1544b9cb14f1e5be794ac1315c78f5e1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEJFOjIwNDZBMTo0Q0Y2MjE6NkVFRjk1OjZBNjIwOEQ5IiwidmlzaXRvcl9pZCI6IjM2MjgzMTA4ODM2NDU2NTUyNTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 509a857497a0bcef0c51b8abb76b2a40d002c1ed1bf2415f3be4bcbfed4cd19a |
| hovercard-subject-tag | issue:944370855 |
| 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/2458/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0a0d3ae6e99d24f8e7dac7d95851b032163db08e7992754dfd6e7873823e27d6/graphql-java/graphql-java/issues/2458 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0a0d3ae6e99d24f8e7dac7d95851b032163db08e7992754dfd6e7873823e27d6/graphql-java/graphql-java/issues/2458 |
| og:image:alt | Describe the bug It looks like variables are coerced twice during an execution using graphql-java 16.2, once in execute and once in validateFieldsAndArguments. This breaks e.g. enums with non-defau... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jenssuhr |
| hostname | github.com |
| expected-hostname | github.com |
| None | be9a4d9589756e22b427637ffbf1123a96e067050e57f5cec403e3080a650ca4 |
| 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 | 7b5509702f01f876c214a2cbb142690847de0019 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width