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

Fragments should generate their own structs #280

Open
JamesPeters98 opened this issue Jan 25, 2023 · 0 comments
Open

Fragments should generate their own structs #280

JamesPeters98 opened this issue Jan 25, 2023 · 0 comments

Comments

@JamesPeters98
Copy link

When generating a client using fragments and lots of similar queries that use the same fragment it leads to lots of the same structs being generated.

Ideally there would be a seperate Fragments struct that contains the defined fragments.

I.e the following queries would both share the same response structs as they use the same fragment:

fragment LoadInfo on Load {
    loadId
    jobContainerId
    name
    loadPlanStatus
    journey {
        journeyId
    }
}

query loadById($load: Int!) {
    loadByID(loadId: $load) {
        ...LoadInfo
    }
}

query loadBySupplier($supplier: String!, $after: LocalDateTime!) {
    loadsBySupplierId(supplierCode: $supplier, after: $after) {
        ...LoadInfo
    }
}

Not sure how feasible that is, but I think something similar is done for input types and enums?

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