So I have just one question that I can't seem to find the solution to, is it possible to setup re-usable fragments across multiple .graphql files. Say for example, in one file called UserProfile.graphql I declare a fragment like:
fragment UserProfile on User {
id
username
profileImage
bio
}
and in another file named MeQuery.graphql and also UpdateProfileMutation.graphql I want to reference that fragment, ideally without duplication.
So it would look a little bit like so:
query MeQuery {
viewer {
...UserProfile
}
}
and
mutation UpdateProfileMutation($input: UpdateProfileMutationInput) {
updateProfile(input: $input) {
viewer {
..UserProfile
}
}
}
I don't think this is possible as of now but I was hoping for some clarification
Yep, this is totally doable. Anywhere a fragment is defined within the module it can be reused.
That's amazing, really loving this library!
Most helpful comment
Yep, this is totally doable. Anywhere a fragment is defined within the module it can be reused.