@parcel/transformer-graphql plugin. When a
.gql file is detected, it will be installed into your project automatically.
Parcel also supports importing fragments defined in separate files into another GraphQL file using a special comment syntax. These will be bundled together into a single GraphQL query and returned to your code as a string.
You can either import all fragments from a file:
# import "fragments.graphql"
# import * from "fragments.graphql"
or list the specific fragments you wish to import:
# import UserFragment, AddressFragment from "fragments.graphql"
Here is a full example showing how to use imports as part of a larger GraphQL query: