Title: Remove deprecated .defaultValue() method · Issue #3285 · graphql-java/graphql-java · GitHub
Open Graph Title: Remove deprecated .defaultValue() method · Issue #3285 · graphql-java/graphql-java
X Title: Remove deprecated .defaultValue() method · Issue #3285 · graphql-java/graphql-java
Description: Use of the deprecated GraphQL-Java method .defaultValue() rather than defaultValueProgrammatic() to specify default null value had resulted in schema linting issues and broken Apollo code generation tooling, but does not cause any immedi...
Open Graph Description: Use of the deprecated GraphQL-Java method .defaultValue() rather than defaultValueProgrammatic() to specify default null value had resulted in schema linting issues and broken Apollo code generatio...
X Description: Use of the deprecated GraphQL-Java method .defaultValue() rather than defaultValueProgrammatic() to specify default null value had resulted in schema linting issues and broken Apollo code generatio...
Opengraph URL: https://github.com/graphql-java/graphql-java/issues/3285
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove deprecated .defaultValue() method","articleBody":"Use of the deprecated GraphQL-Java method `.defaultValue() ` rather than `defaultValueProgrammatic()` to specify default null value had resulted in schema linting issues and broken Apollo code generation tooling, but does not cause any immediate errors upon initial schema generation. Removing this deprecated method entirely would prevent this prevent users from having to create to manually check for usage of `.defaultValue( null )` in their projects. \r\n\r\nFor example when creating a schema generated using SchemaPrinter, usage of .defaultValue( null ) with arguments and with input objects fields will result in the following:\r\n\r\n```\r\nTestQuery(\r\n testArg: Boolean = ,\r\n)\r\n\r\n```\r\n```\r\ninput TestInput {\r\n testField: Boolean = \r\n}\r\n```\r\n Rather than: \r\n```\r\nTestQuery(\r\n testArg: Boolean = null,\r\n)\r\n```\r\n\r\n\r\n```\r\ninput TestInput {\r\n testField: Boolean = null\r\n}\r\n```\r\n\r\n\r\nIn the JSON schema generated using IntrospectionQuery, this incorrectly manifests itself as shown below with defaultValue: \"\" . This breaks Apollo code generation tooling.\r\n\r\n```\r\n{\r\n \"name\" : \"testField\",\r\n \"description\" : null,\r\n \"type\" : {\r\n \"kind\" : \"SCALAR\",\r\n \"name\" : \"Boolean\",\r\n \"ofType\" : null\r\n },\r\n \"defaultValue\" : \"\",\r\n \"isDeprecated\" : false,\r\n \"deprecationReason\" : null\r\n}\r\n```\r\ninstead of defaultValue: \"null\"\r\n\r\n```\r\n{\r\n \"name\" : \"testField\",\r\n \"description\" : null,\r\n \"type\" : {\r\n \"kind\" : \"SCALAR\",\r\n \"name\" : \"Boolean\",\r\n \"ofType\" : null\r\n },\r\n \"defaultValue\" : \"null\",\r\n \"isDeprecated\" : false,\r\n \"deprecationReason\" : null\r\n}\r\n```","author":{"url":"https://github.com/georgeVlady0","@type":"Person","name":"georgeVlady0"},"datePublished":"2023-08-07T20:02:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/3285/graphql-java/issues/3285"}
| 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:096cc625-9088-ddbd-4a6f-9d5fa0d063bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C776:5693E:2F156C:3EFC88:6A61346C |
| html-safe-nonce | ef9d021a92c7dd52fd4ebf71aa9c254bd4976af6e1cea2e5143dc14dbf88b3d8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzc2OjU2OTNFOjJGMTU2QzozRUZDODg6NkE2MTM0NkMiLCJ2aXNpdG9yX2lkIjoiMzE2NzIwOTUzODQxMzczNzA2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 84fdb5a51ef1d679e41fa24a9299e2299b6d879ca0bf9e78b26ac87c3f8049b4 |
| hovercard-subject-tag | issue:1840128493 |
| 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/3285/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5f0a0445ce713eb2f4c52b00b8aada576ee3a5eb34ebd48bd3a0c80c20cb8c3c/graphql-java/graphql-java/issues/3285 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5f0a0445ce713eb2f4c52b00b8aada576ee3a5eb34ebd48bd3a0c80c20cb8c3c/graphql-java/graphql-java/issues/3285 |
| og:image:alt | Use of the deprecated GraphQL-Java method .defaultValue() rather than defaultValueProgrammatic() to specify default null value had resulted in schema linting issues and broken Apollo code generatio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | georgeVlady0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c5eca2d5d770261725d2d44a57879a5bd9643e5b84204081dc36933ab40e63a2 |
| 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 | dac3a1c903b48538720e0bc780047237dd89fd4c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width