heftapp / graphql_codegen

MIT License
146 stars 53 forks source link

Remove edges and node from parsed data #343

Open jlukas99 opened 7 months ago

jlukas99 commented 7 months ago

Hi, would it be possible to add an option when parsing data to be without edges and node?

Example:

from

{
    "data": {
        "markers": {
            "edges": [
                {
                    "node": {
                        "addresses": {
                            "edges": [
                                {
                                    "node": {
                                        "geo": {
                                            "lat": 50.2699800871087,
                                            "long": 19.003614752063
                                        }
                                    }
                                },
                                {
                                    "node": {
                                        "geo": {
                                            "lat": 52.296189564637,
                                            "long": 20.9322076727827
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }
    }
}

to

{
    "data": {
        "markers": [
            {
                "addresses": [
                    {
                        "geo": {
                            "lat": 50.2699800871087,
                            "long": 19.003614752063
                        }
                    },
                    {
                        "geo": {
                            "lat": 52.296189564637,
                            "long": 20.9322076727827
                        }
                    }
                ]
            }
        ]
    }
}
github-actions[bot] commented 7 months ago

👋 @jlukas99 Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible. Please make sure you have provided enough context.

This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.

budde377 commented 7 months ago

I think there’s an interesting discussion on if and how we can make the generator utilise patterns such as the connection pattern. It would be interesting to look into.

On Wed, 27 Mar 2024 at 09:06, github-actions[bot] @.***> wrote:

👋 @jlukas99 https://github.com/jlukas99 Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible. Please make sure you have provided enough context.

This library is created and maintained by me, @budde377 https://github.com/budde377. Please consider supporting my work and ensure our survival by donating here https://github.com/sponsors/heftapp .

— Reply to this email directly, view it on GitHub https://github.com/heftapp/graphql_codegen/issues/343#issuecomment-2022261983, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2UFS2MNJTK47VECCDPCIDY2KD2HAVCNFSM6AAAAABFKORYBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRSGI3DCOJYGM . You are receiving this because you were mentioned.Message ID: @.***>