René's URL Explorer Experiment


Title: How to use custom directives alongside `graphql.java.extended.validation` · Issue #74 · graphql-java/graphql-java-extended-validation · GitHub

Open Graph Title: How to use custom directives alongside `graphql.java.extended.validation` · Issue #74 · graphql-java/graphql-java-extended-validation

X Title: How to use custom directives alongside `graphql.java.extended.validation` · Issue #74 · graphql-java/graphql-java-extended-validation

Description: Describe the bug When wiring the default graphql.java.extended.validation setup with the RuntimeWiringConfigurer provided by the new Spring for GraphQL project, custom directives that are registered via the builders directive() method do...

Open Graph Description: Describe the bug When wiring the default graphql.java.extended.validation setup with the RuntimeWiringConfigurer provided by the new Spring for GraphQL project, custom directives that are registere...

X Description: Describe the bug When wiring the default graphql.java.extended.validation setup with the RuntimeWiringConfigurer provided by the new Spring for GraphQL project, custom directives that are registere...

Opengraph URL: https://github.com/graphql-java/graphql-java-extended-validation/issues/74

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to use custom directives alongside `graphql.java.extended.validation`","articleBody":"**Describe the bug**\r\nWhen wiring the default `graphql.java.extended.validation` setup with the `RuntimeWiringConfigurer` provided by the new `Spring for GraphQL` project, custom directives that are registered via the builders `directive()` method don't seem to apply anymore.\r\n\r\n**To Reproduce**\r\n\r\n1. Implement the official `graphql-java` [`DateFormattingDirective`](https://www.graphql-java.com/documentation/sdl-directives#another-example---date-formatting):\r\n\r\n```graphql\r\ndirective @DateFormat on FIELD_DEFINITION\r\n\r\ntype Person {\r\n    id: ID!\r\n    name: String!\r\n    createdAt: String! @DateFormat\r\n}\r\n```\r\n\r\n```java\r\npublic class DateFormattingDirective implements SchemaDirectiveWiring {\r\n\r\n    private static final String FORMAT = \"format\";\r\n\r\n    @Override\r\n    public GraphQLFieldDefinition onField(\r\n        SchemaDirectiveWiringEnvironment\u003cGraphQLFieldDefinition> env) {\r\n\r\n        GraphQLFieldDefinition fieldDefinition = env.getElement();\r\n        GraphQLFieldsContainer fieldsContainer = env.getFieldsContainer();\r\n\r\n        // DataFetcherFactories.wrapDataFetcher is a helper to wrap data fetchers so that\r\n        // CompletionStage is handled correctly along with POJOs\r\n        DataFetcher\u003c?> originalFetcher = env.getCodeRegistry()\r\n            .getDataFetcher(fieldsContainer, fieldDefinition);\r\n        DataFetcher\u003c?> dataFetcher = DataFetcherFactories.wrapDataFetcher(originalFetcher,\r\n            ((dataFetchingEnvironment, value) -> {\r\n\r\n                if (value instanceof LocalDateTime localDateTime\r\n                    && dataFetchingEnvironment.containsArgument(FORMAT)) {\r\n\r\n                    String dateTimePattern = dataFetchingEnvironment.getArgument(FORMAT);\r\n                    DateTimeFormatter dateTimeFormatter = buildFormatter(dateTimePattern);\r\n                        return dateTimeFormatter.format(localDateTime);\r\n                    }\r\n                }\r\n\r\n                return value;\r\n            }));\r\n\r\n        // This will extend the field by adding a new \"format\" argument to it for the date\r\n        // formatting which allows clients to opt into.\r\n        FieldCoordinates coordinates = FieldCoordinates.coordinates(fieldsContainer,\r\n            fieldDefinition);\r\n        env.getCodeRegistry().dataFetcher(coordinates, dataFetcher);\r\n\r\n        return fieldDefinition.transform(builder -> builder.argument(\r\n            GraphQLArgument.newArgument().name(FORMAT).type(Scalars.GraphQLString)));\r\n    }\r\n\r\n    private static DateTimeFormatter buildFormatter(String format) {\r\n        return DateTimeFormatter.ofPattern(format);\r\n    }\r\n}\r\n```\r\n\r\n2. Wire the custom `DateFormattingDirective` alongside the standard setup of the `graphql.java.extended.validation` project:\r\n\r\n```java\r\n@Configuration\r\npublic class GraphQLConfig {\r\n  \r\n    @Bean\r\n    public RuntimeWiringConfigurer validationConfigurer() {\r\n        ValidationRules validationRules = ValidationRules.newValidationRules()\r\n            .onValidationErrorStrategy(OnValidationErrorStrategy.RETURN_NULL)\r\n            .build();\r\n\r\n        ValidationSchemaWiring schemaWiring = new ValidationSchemaWiring(validationRules);\r\n\r\n        return builder -> builder.directiveWiring(schemaWiring).build();\r\n    }\r\n\r\n    @Bean\r\n    public RuntimeWiringConfigurer directiveConfigurer() {\r\n        return builder -> builder\r\n            .directive(\"DateFormat\", new DateFormattingDirective())\r\n            .build();\r\n    }\r\n}\r\n``` \r\n\r\n3. See the functionality of the custom `DateFormattingDirective` disappear.\r\n\r\nWithout `graphql.java.extended.validation`:\r\n![grafik](https://user-images.githubusercontent.com/45827409/189409012-4ca75ce4-5c0e-4818-9be0-de7bbb50cc32.png)\r\n\r\nWith `graphql.java.extended.validation`:\r\n![grafik](https://user-images.githubusercontent.com/45827409/189409234-15dd2d96-bc2a-4bff-ad30-919a9fe58798.png)\r\n\r\n> Note, Registering both `graphql.java.extended.validation` `SchemaWiring` and `CustomDirective` inside a single `Bean` wont help either.","author":{"url":"https://github.com/paulbuechner","@type":"Person","name":"paulbuechner"},"datePublished":"2022-09-09T17:25:01Z","url":"https://github.com/graphql-java/graphql-java-extended-validation/issues/74"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bd71e04b-395b-bce5-6ae0-2e4da75b8535
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCA4E:E3C4F:231CC41:2CC1A40:6B01866A
html-safe-nonce845a97760de35bd95edd4c1dd2f384cdbb4de7f3e8310c54d8b72769f9c956d6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTRFOkUzQzRGOjIzMUNDNDE6MkNDMUE0MDo2QjAxODY2QSIsInZpc2l0b3JfaWQiOiI3MzQwNjMzMzI3MjgxNDczMTMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac559afa6c087c2ee63792ddbd92681641bf8c289e069dcd1793a8509ae50cd55e
hovercard-subject-tagissue:1368122353
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/graphql-java/graphql-java-extended-validation/74/issue_layout
twitter:imagehttps://opengraph.githubassets.com/952302587d585b2d5d26b594624e401c2ad7c34b9b5880e840f9b1d650bdb81b/graphql-java/graphql-java-extended-validation/issues/74
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/952302587d585b2d5d26b594624e401c2ad7c34b9b5880e840f9b1d650bdb81b/graphql-java/graphql-java-extended-validation/issues/74
og:image:altDescribe the bug When wiring the default graphql.java.extended.validation setup with the RuntimeWiringConfigurer provided by the new Spring for GraphQL project, custom directives that are registere...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepaulbuechner
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/graphql-java/graphql-java-extended-validation git https://github.com/graphql-java/graphql-java-extended-validation.git
octolytics-dimension-user_id14289921
octolytics-dimension-user_logingraphql-java
octolytics-dimension-repository_id205507809
octolytics-dimension-repository_nwographql-java/graphql-java-extended-validation
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id205507809
octolytics-dimension-repository_network_root_nwographql-java/graphql-java-extended-validation
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/graphql-java/graphql-java-extended-validation/issues/74#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java-extended-validation%2Fissues%2F74
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java-extended-validation%2Fissues%2F74
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=graphql-java%2Fgraphql-java-extended-validation
Reloadhttps://github.com/graphql-java/graphql-java-extended-validation/issues/74
Reloadhttps://github.com/graphql-java/graphql-java-extended-validation/issues/74
Reloadhttps://github.com/graphql-java/graphql-java-extended-validation/issues/74
graphql-javahttps://github.com/graphql-java
graphql-java-extended-validationhttps://github.com/graphql-java/graphql-java-extended-validation
Codehttps://github.com/graphql-java/graphql-java-extended-validation
Issues9 (9)https://github.com/graphql-java/graphql-java-extended-validation/issues
Pull requests9 (9)https://github.com/graphql-java/graphql-java-extended-validation/pulls
Actionshttps://github.com/graphql-java/graphql-java-extended-validation/actions
Projectshttps://github.com/graphql-java/graphql-java-extended-validation/projects
Security and qualityhttps://github.com/graphql-java/graphql-java-extended-validation/security
Insightshttps://github.com/graphql-java/graphql-java-extended-validation/insights
https://github.com/graphql-java/graphql-java-extended-validation
New issuehttps://github.com/login?return_to=https://github.com/graphql-java/graphql-java-extended-validation/issues/74
New issuehttps://github.com/login?return_to=https://github.com/graphql-java/graphql-java-extended-validation/issues/74
How to use custom directives alongside graphql.java.extended.validationhttps://github.com/graphql-java/graphql-java-extended-validation/issues/74#top
https://github.com/paulbuechner
paulbuechnerhttps://github.com/paulbuechner
on Sep 9, 2022https://github.com/graphql-java/graphql-java-extended-validation/issues/74#issue-1368122353
DateFormattingDirectivehttps://www.graphql-java.com/documentation/sdl-directives#another-example---date-formatting
https://user-images.githubusercontent.com/45827409/189409012-4ca75ce4-5c0e-4818-9be0-de7bbb50cc32.png
https://user-images.githubusercontent.com/45827409/189409234-15dd2d96-bc2a-4bff-ad30-919a9fe58798.png
https://github.com/yeikel
yeikelhttps://github.com/yeikel
on Jun 17, 2024https://github.com/graphql-java/graphql-java-extended-validation/issues/74#issuecomment-2174633361
Sign up for freehttps://github.com/signup?return_to=https://github.com/graphql-java/graphql-java-extended-validation/issues/74
Sign in to commenthttps://github.com/login?return_to=https://github.com/graphql-java/graphql-java-extended-validation/issues/74
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.