Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to cascade the GraphQL field resolvers in Springboot app #1217

Open
dkveera16 opened this issue May 24, 2023 · 6 comments
Open

Ability to cascade the GraphQL field resolvers in Springboot app #1217

dkveera16 opened this issue May 24, 2023 · 6 comments

Comments

@dkveera16
Copy link

I am trying to build an aggregator function using GraphQL as the front , which invokes REST and GraphQL services.
I am able to get the list of request fields from DataFetchingEnvironment variable.
I am unable to cascade the list of fields and use it for the next call that I make to another GraphQl Service.
Is there way for this to be done?

@kobylynskyi
Copy link
Owner

If I understand your problem statement correctly, you could try setting the following config in your build configuration:
generateDataFetchingEnvironmentArgumentInApis=true

@dkveera16
Copy link
Author

dkveera16 commented May 24, 2023 via email

@dkveera16
Copy link
Author

Hi @kobylynskyi ,
Not sure if you had a chance to look at this?
My current Springboot app gets a list of fields that it needs to respond with, but when it calls another Graphql app, it is not able to inform what are the fields.

@kobylynskyi
Copy link
Owner

@dkveera16 can you please clarify a little bit more (perhaps with some examples) about what are you trying to achieve. Thanks.

@dkveera16
Copy link
Author

dkveera16 commented Jun 6, 2023

Hi,
We have an aggregator APP (AGG) that collects information from various sources( B , C).
All three apps have graphql .
Lets take a simple schema
type BlogPost {
title: String
content: String
}

All three apps have the same schema. So if I call AGG app and say I need only title, I should be able to pass this to B and C and retrieve only title from B and C.
Currently I can see that AGG has full awareness that it needs only title. But there is no way to cascade that when we build B or C queries.
This means that we are always getting back title and content from b and c.
I am hoping there is a constructor that I can use when building queries in b an c where I can pass arguments that I received from datafetchers.

Hope this clarifies the question

@dkveera16
Copy link
Author

Hi @kobylynskyi , Did you get a chance to look into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants