Company
Date Published
Author
Dhaivat Pandya
Word count
773
Language
English
Hacker News points
None

Summary

The Webpack loader for GraphQL documents has been updated to allow users to import fragment definitions from other .graphql files, making it easier to share fragments across multiple queries. This feature is achieved through the use of a preprocessor called graphql-tag/loader, which converts GraphQL comments into require statements and parses the resulting code. With this update, developers can now place their GraphQL query documents in separate files, outside of their view component definitions, and share fragments across those documents without having to import them separately within their JavaScript code. This feature is particularly useful for building tools such as persisted queries, which will be supported by the loader soon.