Home / Companies / Apollo / Blog / Post Details
Content Deep Dive

Webpack’ing your GraphQL Documents

Blog post from Apollo

Post Details
Company
Date Published
Author
Dhaivat Pandya
Word Count
773
Company Posts That Month
5
Language
English
Hacker News Points
-
Post removed?
No
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.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.