Skip to content

Allow to share fragments #413

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

Open
Sytten opened this issue Mar 24, 2022 · 3 comments
Open

Allow to share fragments #413

Sytten opened this issue Mar 24, 2022 · 3 comments

Comments

@Sytten
Copy link
Contributor

Sytten commented Mar 24, 2022

Currently all operations need to be in the same file if you want to be able to share fragments.
I would be nice if we could specify a list of files in the derive arguments to specify shared things.
Something like:

#[graphql(
    schema_path = "../schema.graphql",
    query_path = "tests/common/operations/mutations.graphql",
    shared_paths = "tests/common/operations/fragments.graphql, tests/common/operations/other.graphql",
    response_derives = "Debug"
)]
@NobbZ
Copy link

NobbZ commented Mar 24, 2023

Can't we alternatively allow magic comments similar to the import statements in apollo + webpack?

https://www.apollographql.com/docs/react/data/fragments/#importing-fragments-when-using-webpack

I would prefer such an explicit import in the GraphQL file over something only mentioned in the rust files.

@DirkRusche
Copy link

Is #312 something that might help to resolve first, so this issue here becomes easier?

@tomhoule
Copy link
Member

tomhoule commented Apr 3, 2025

I think it's the same issue.

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

4 participants