Title: Better describe what `Coercing.valueToLiteral` is for · Issue #3558 · graphql-java/graphql-java · GitHub
Open Graph Title: Better describe what `Coercing.valueToLiteral` is for · Issue #3558 · graphql-java/graphql-java
X Title: Better describe what `Coercing.valueToLiteral` is for · Issue #3558 · graphql-java/graphql-java
Description: While upgrading to GraphQL Java 21, I stumbled over the method valueToLiteral offered by the Coercing interface. So far, when implementing a custom scalar, I haven't bothered about implementing this method and have not encountered any pr...
Open Graph Description: While upgrading to GraphQL Java 21, I stumbled over the method valueToLiteral offered by the Coercing interface. So far, when implementing a custom scalar, I haven't bothered about implementing thi...
X Description: While upgrading to GraphQL Java 21, I stumbled over the method valueToLiteral offered by the Coercing interface. So far, when implementing a custom scalar, I haven't bothered about implementing...
Opengraph URL: https://github.com/graphql-java/graphql-java/issues/3558
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Better describe what `Coercing.valueToLiteral` is for","articleBody":"While upgrading to GraphQL Java 21, I stumbled over the method `valueToLiteral` offered by the `Coercing` interface. So far, when implementing a custom scalar, I haven't bothered about implementing this method and have not encountered any problems so far although the default implementation throws an exception.\r\n\r\nIn the JavaDoc of the `Coercing` interface, it says that \"every valid external input values for `parseValue(Object)` is also valid for `valueToLiteral(Object)` and vice versa\" which suggest that the argument to `valueToLiteral` should be in serialized form. However, when looking at implementations of this method, I see that most often `serialze` is called first on the argument, which suggests otherwise.\r\n\r\nCould you please improve the JavaDoc and also the [documentation](https://www.graphql-java.com/documentation/scalars/) on custom scalars, which does not mention this method at all?","author":{"url":"https://github.com/ummels","@type":"Person","name":"ummels"},"datePublished":"2024-04-08T06:49:26Z","url":"https://github.com/graphql-java/graphql-java/issues/3558"}
| 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:a0c1dca4-ab18-c9e8-ec0d-d6bdbfe6d411 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A538:29FFA9:255E8FA:2F5186A:6B0188C2 |
| html-safe-nonce | 51c65792ee7bf5dae57e84311f50c97a6f9d786435d42717634baaf27bb086dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTM4OjI5RkZBOToyNTVFOEZBOjJGNTE4NkE6NkIwMTg4QzIiLCJ2aXNpdG9yX2lkIjoiMzU1MjE2MjI3NzQzNDE2NTQ0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d7a6191d64a8f9103691798bb420f657d928411adf8788cf523b8b9052430005 |
| hovercard-subject-tag | issue:2230400102 |
| 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/3558/issue_layout |
| twitter:image | https://opengraph.githubassets.com/232d04d679163d7968b48f818e1b62a203c962932ed447bfb56baf7cf50ef3d1/graphql-java/graphql-java/issues/3558 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/232d04d679163d7968b48f818e1b62a203c962932ed447bfb56baf7cf50ef3d1/graphql-java/graphql-java/issues/3558 |
| og:image:alt | While upgrading to GraphQL Java 21, I stumbled over the method valueToLiteral offered by the Coercing interface. So far, when implementing a custom scalar, I haven't bothered about implementing thi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ummels |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width