diff --git a/docs/source/data/fragments.mdx b/docs/source/data/fragments.mdx index 399c922c938..e0f1d3a3911 100644 --- a/docs/source/data/fragments.mdx +++ b/docs/source/data/fragments.mdx @@ -1790,3 +1790,17 @@ The following masking utility types are available to override: - `Unmasked` - Unwraps `TData` into the full result type For more information about other overridable types in Apollo Client, see the [TypeScript guide](../development-testing/static-typing). + +## Troubleshooting + +### Unique names + +Fragment names must be unique across your entire application. If you reuse a fragment name, `graphql-tag` provides a warning about the conflict at runtime to help you identify the issue: + +```text +Warning: fragment with name SomeFragment already exists. +graphql-tag enforces all fragment names across your application to be unique; read more about +this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names +``` + +As a best practice, use descriptive, component-scoped fragment names (like `CartItemFragment` or `UserProfileCardFragment`) to avoid name collisions.