René's URL Explorer Experiment


Title: [Spring Graphql] Knowing which fields are requested by a query/subscription? · graphql-java/graphql-java · Discussion #3444 · GitHub

Open Graph Title: [Spring Graphql] Knowing which fields are requested by a query/subscription? · graphql-java/graphql-java · Discussion #3444

X Title: [Spring Graphql] Knowing which fields are requested by a query/subscription? · graphql-java/graphql-java · Discussion #3444

Description: [Spring Graphql] Knowing which fields are requested by a query/subscription?

Open Graph Description: I'm trying to make a GraphQL interface on top of the data coming from a very slow physical device (I have both a solar converter and a heatpump that both only speak modbus). The root problem I have...

X Description: I'm trying to make a GraphQL interface on top of the data coming from a very slow physical device (I have both a solar converter and a heatpump that both only speak modbus). The root problem I ...

Opengraph URL: https://github.com/graphql-java/graphql-java/discussions/3444

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"[Spring Graphql] Knowing which fields are requested by a query/subscription?","text":"

I'm trying to make a GraphQL interface on top of the data coming from a very slow physical device (I have both a solar converter and a heatpump that both only speak modbus).

\n

The root problem I have is that these devices have many fields available (my solarconverter has a few hundred fields) and there is a limit on modbus of a maximum of only 125 fields per call. On some of my devices such a call sometimes takes almost a second.

\n

To allow getting the data as often as possible I want to only fetch the fields from the real device for which there is an actual need in either a query or subscription.

\n

In a related project (not modbus, so I get the full record in all cases) I have used the Spring Graphql library and used a QueryMapping and a SubscriptionMapping to implement the query and subscription.

\n

This works fine but I do not see a way to get the data I think I need.

\n

For the modbus case I see a need to have

\n\n

The only example code I have found so far that does something like this was this ~7 year old StockTickerWebSocket example.
\nThis does however use something completely different than Spring-graphql.

\n

What I'm looking for a some guidance going into the right direction.

\n\n

In all of the above: Any example/javadoc/code link that points me towards how to do this is highly appreciated.

\n

Thanks.

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

The bottom of this article is about you need I believe. I tried it a few weeks ago in a Spring 3 app and the context includes the fields got queried.

","upvoteCount":1,"url":"https://github.com/graphql-java/graphql-java/discussions/3444#discussioncomment-8476584"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:6759d702-7c95-de61-332b-23c811a11a67
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-idA358:2D650D:C2E0E4:1146219:696FBB70
html-safe-nonce4f2172526965ddaf526b251ce380fd9eea3febdfe7a3ab045b5193003f5e3116
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzU4OjJENjUwRDpDMkUwRTQ6MTE0NjIxOTo2OTZGQkI3MCIsInZpc2l0b3JfaWQiOiI2NDU2NDU2NjU4MDI3NTI3MDI0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacad65e4832c92847f604a631ea31bec01ae1976db379d615d8d105cc59578f8c4
hovercard-subject-tagdiscussion:6206190
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/graphql-java/graphql-java/3444/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/3dca758682df82a85121976159d919d92601c26a4359003c848e894862266a6a/graphql-java/graphql-java/discussions/3444
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3dca758682df82a85121976159d919d92601c26a4359003c848e894862266a6a/graphql-java/graphql-java/discussions/3444
og:image:altI'm trying to make a GraphQL interface on top of the data coming from a very slow physical device (I have both a solar converter and a heatpump that both only speak modbus). The root problem I have...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None40ce4030a7db32193be29054756ed7f7eceec3a82973f060300035bdff8cf777
turbo-cache-controlno-preview
go-importgithub.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git
octolytics-dimension-user_id14289921
octolytics-dimension-user_logingraphql-java
octolytics-dimension-repository_id38602457
octolytics-dimension-repository_nwographql-java/graphql-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id38602457
octolytics-dimension-repository_network_root_nwographql-java/graphql-java
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
release1cdcabe0d7ddc4be91a713d57280849e4c89f5cd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fdiscussions%2F3444
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fdiscussions%2F3444
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=graphql-java%2Fgraphql-java
Reloadhttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
Reloadhttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
Reloadhttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
graphql-java https://patch-diff.githubusercontent.com/graphql-java
graphql-javahttps://patch-diff.githubusercontent.com/graphql-java/graphql-java
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fgraphql-java%2Fgraphql-java
Fork 1.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fgraphql-java%2Fgraphql-java
Star 6.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fgraphql-java%2Fgraphql-java
Code https://patch-diff.githubusercontent.com/graphql-java/graphql-java
Issues 40 https://patch-diff.githubusercontent.com/graphql-java/graphql-java/issues
Pull requests 17 https://patch-diff.githubusercontent.com/graphql-java/graphql-java/pulls
Discussions https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions
Actions https://patch-diff.githubusercontent.com/graphql-java/graphql-java/actions
Projects 0 https://patch-diff.githubusercontent.com/graphql-java/graphql-java/projects
Wiki https://patch-diff.githubusercontent.com/graphql-java/graphql-java/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/graphql-java/graphql-java/security
Please reload this pagehttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
Insights https://patch-diff.githubusercontent.com/graphql-java/graphql-java/pulse
Code https://patch-diff.githubusercontent.com/graphql-java/graphql-java
Issues https://patch-diff.githubusercontent.com/graphql-java/graphql-java/issues
Pull requests https://patch-diff.githubusercontent.com/graphql-java/graphql-java/pulls
Discussions https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions
Actions https://patch-diff.githubusercontent.com/graphql-java/graphql-java/actions
Projects https://patch-diff.githubusercontent.com/graphql-java/graphql-java/projects
Wiki https://patch-diff.githubusercontent.com/graphql-java/graphql-java/wiki
Security https://patch-diff.githubusercontent.com/graphql-java/graphql-java/security
Insights https://patch-diff.githubusercontent.com/graphql-java/graphql-java/pulse
Answered https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#discussioncomment-8476584
Andras-Csanyihttps://patch-diff.githubusercontent.com/Andras-Csanyi
nielsbasjes https://patch-diff.githubusercontent.com/nielsbasjes
Q&Ahttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/categories/q-a
[Spring Graphql] Knowing which fields are requested by a query/subscription? https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#top
nielsbasjes https://patch-diff.githubusercontent.com/nielsbasjes
Answered https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#discussioncomment-8476584
Andras-Csanyihttps://patch-diff.githubusercontent.com/Andras-Csanyi
Return to tophttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#top
Please reload this pagehttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
nielsbasjes https://patch-diff.githubusercontent.com/nielsbasjes
Feb 11, 2024 https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#discussion-6206190
modbushttps://en.wikipedia.org/wiki/Modbus
QueryMappinghttps://github.com/nielsbasjes/dsmr-tools/blob/ecf66a764cf81c3522e752f3d6c5a062422e77ac/dsmr-graphql/src/main/java/nl/basjes/dsmr/graphql/GraphQlRequestHandler.java#L49-L54
SubscriptionMappinghttps://github.com/nielsbasjes/dsmr-tools/blob/ecf66a764cf81c3522e752f3d6c5a062422e77ac/dsmr-graphql/src/main/java/nl/basjes/dsmr/graphql/GraphQlRequestHandler.java#L65-L74
StockTickerWebSockethttps://github.com/graphql-java/graphql-java-subscription-example/blob/master/src/main/java/com/graphql/example/http/StockTickerWebSocket.java
Give feedback.https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
Andras-Csanyi https://patch-diff.githubusercontent.com/Andras-Csanyi
Feb 15, 2024 https://github.com/graphql-java/graphql-java/discussions/3444#discussioncomment-8476584
thishttps://www.graphql-java.com/blog/deep-dive-data-fetcher-results
View full answer https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#discussioncomment-8476584
Oldest https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444?sort=old
Newest https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444?sort=new
Top https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444?sort=top
Please reload this pagehttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
Andras-Csanyi https://patch-diff.githubusercontent.com/Andras-Csanyi
Feb 15, 2024 https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#discussioncomment-8476584
thishttps://www.graphql-java.com/blog/deep-dive-data-fetcher-results
Give feedback.https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
https://patch-diff.githubusercontent.com/nielsbasjes
Please reload this pagehttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
nielsbasjeshttps://patch-diff.githubusercontent.com/nielsbasjes
Feb 15, 2024 https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#discussioncomment-8482031
Give feedback.https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
https://patch-diff.githubusercontent.com/nielsbasjes
Please reload this pagehttps://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
nielsbasjeshttps://patch-diff.githubusercontent.com/nielsbasjes
Jul 14, 2025 https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444#discussioncomment-13751677
https://github.com/nielsbasjes/modbus-graphql/https://github.com/nielsbasjes/modbus-graphql/
herehttps://github.com/nielsbasjes/modbus-graphql/blob/00adc5ea0a980cd8b1d56bef912bc736d77c9841/modbus-graphql-common/src/main/kotlin/nl/basjes/modbus/graphql/GraphQLSchemaModbusSchema.kt
this codehttps://github.com/nielsbasjes/modbus-graphql/blob/00adc5ea0a980cd8b1d56bef912bc736d77c9841/modbus-graphql-common/src/main/kotlin/nl/basjes/modbus/graphql/SchemaDeviceGraphQLResolver.kt#L72-L82
Give feedback.https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
nielsbasjeshttps://patch-diff.githubusercontent.com/nielsbasjes
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fdiscussions%2F3444
🙏 Q&A https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/categories/q-a
https://patch-diff.githubusercontent.com/nielsbasjes
https://patch-diff.githubusercontent.com/Andras-Csanyi
https://patch-diff.githubusercontent.com/graphql-java/graphql-java/discussions/3444
https://patch-diff.githubusercontent.com/settings/replies?return_to=1
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.