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

Support sharing fragments #117

Open
davidmwhynot opened this issue Aug 30, 2020 · 0 comments
Open

Support sharing fragments #117

davidmwhynot opened this issue Aug 30, 2020 · 0 comments

Comments

@davidmwhynot
Copy link

It would be great if there was a way to either grab just specific operations from a specific file, or, alternatively, supply a path to a file containing fragments field as an argument to loader. i.e.

export const storesQuery: DocumentNode<
	Operations.StoresQuery,
	Operations.StoresQueryVariables
> = loader('../queries/stores.graphql', {
        fragments: '../fragments.graphql'
});

or something to that affect.

I'm guessing that this approach would be much simpler to implement than being able to have all of the queries and operations in a single file. I'm not an expert, but based on looking at what happens when you console.log a file that is loaded in with multiple operations, you would have to somehow extract the relevant properties/fields from the AST and make them available after parsing the 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