-
-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Closed
Milestone
Description
#3909 added support for importing *.graphql files. This is only useful for GraphQL libraries that want to consume the AST from the graphql package at the particular version bundled with CRA. This ties the upgrade of graphql and CRA together which seems limiting.
Relay (which doesn't import GraphQL, but instead uses inline GraphQL) solves this in the next version by supporting babel-plugin-macros which will look similar to:
import graphql from 'babel-plugin-relay/macro';
graphql`fragment Test on User { name }`
I'm not sure if loaders could be made 'injectable' in some way, but decoupling the projects might make upgrades easier going forward.
I want to add that keeping *.graphql require support specific to Apollo doesn't get in the way of Relay's solution.
Metadata
Metadata
Assignees
Labels
No labels