Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR (built on top of the diff for #8) introduces support for
graphql-import
-style import directives, as outlined in #3. While there's still no official spec for modularizing GraphQL schemas and operations across files, thegraphql-import
package gets over half a million downloads a week, so seems like the likeliest thing we should attempt syntactic compatibility with for the time being.A couple thoughts/questions:
#import
➡️# import * from
in all.graphql
files in a given codebase.This doesn't support renaming identifiers as described in Fragment can't be imported more than once #1 (andI think I was misremembering the heart of that issue. The way this actually stands, if you want to import and usegraphql-import
doesn't support that at all), but it at least opens the door to it if that's something folks decide is worth investing in down the line.Foo
, and it referencesBar
, you'd have to# import Foo, Bar from ...
in order for that to work. That does solve Fragment can't be imported more than once #1, but is probably more painful in the general case—maybe that's just when you fall back toimport *
🤔