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

Is it possible to retrieve attributes from a request? #510

Open
btudor-90 opened this issue Aug 21, 2024 · 1 comment
Open

Is it possible to retrieve attributes from a request? #510

btudor-90 opened this issue Aug 21, 2024 · 1 comment

Comments

@btudor-90
Copy link

I'm migrating a legacy node/graphql application to springboot. My queries are dynamically generated on the frontend, and can potentially go 10 nested entities deep. Instead of pulling all of this data from the database every time, I'd rather only pull requested entities.

query Assets($meta: Meta_Asset!, $search: Search_Asset, $filters: AssetFilters) {
  Assets(meta: $meta, search: $search, filters: $filters) {
    total
    scrollid
    search_after
    source {
      AssetCode
      PhysicalLocation {
        Location {
          Company {
          ...

Is it possible to parse the raw query from the @GraphQLQuery(name = "Assets") e.g. see that source contains AssetCode.PhysicalLocation.Location.Company

@btudor-90
Copy link
Author

Resolved. I'm still learning Graph and this framework.

    @GraphQLQuery(name = "Assets")
    public AssetResponse Assets(
            @GraphQLArgument(name = "meta") MetaAsset meta,
            @GraphQLArgument(name = "search") SearchAsset search,
            @GraphQLArgument(name = "filters") AssetFilters filters) {
        
        AssetResponse response = new AssetResponse();
        
        return response;
    }

    @GraphQLQuery(name = "PhysicalLocation")
    public SbAssetLocation PhysicalLocation(@GraphQLContext SbAsset asset){
        return new SbAssetLocation();
    }

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

1 participant