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

[gql_build] Support shared fragments #127

Closed
MattGson opened this issue Aug 5, 2020 · 1 comment
Closed

[gql_build] Support shared fragments #127

MattGson opened this issue Aug 5, 2020 · 1 comment

Comments

@MattGson
Copy link

MattGson commented Aug 5, 2020

As far as I can tell, there is no way to have multiple queries use shared fragments
i.e.

fragment someFragment on C {
fields
}

query A {
someField
...someFragment
}

query B {
someField
...someFragment
}

A normal use of fragments is to extract shared pieces of queries.
This is pretty important in dart as types are not structural like other languages such as Typescript.
That means if I want to render a shared widget using the query data, I cannot mix and match data from query A and query B even if the types are structurally the same.

@MattGson MattGson changed the title Support shared fragments [gql_build] Support shared fragments Aug 5, 2020
@MattGson MattGson closed this as completed Aug 5, 2020
@MattGson
Copy link
Author

MattGson commented Aug 5, 2020

Was able to do this using #import "./MyFragment.graphql" at the top of each query file.

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