Skip to content

Commit b0aa430

Browse files
committed
Move to troubleshooting section
1 parent e06ec68 commit b0aa430

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

docs/source/data/fragments.mdx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,6 @@ query GetPerson {
4141

4242
Changes to the `NameParts` fragment automatically update the fields included in any operations that use it. This reduces the effort required to keep fields consistent across a set of operations.
4343

44-
## Unique fragment names {#unique-names}
45-
46-
Fragment names must be unique across your entire application. If you reuse a fragment name, the `graphql-tag` library warns about the conflict at runtime to help prevent bugs:
47-
48-
```text
49-
Warning: fragment with name SomeFragment already exists.
50-
graphql-tag enforces all fragment names across your application to be unique; read more about
51-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
52-
```
53-
54-
As a best practice, use descriptive, component-scoped fragment names (like `ItemFragment` or `UserProfileFragment`) to avoid name collisions.
55-
5644
## Example usage
5745

5846
Let's say we have a blog application that executes several GraphQL operations related to comments (submitting a comment, fetching a post's comments, etc.). Our application likely has a `Comment` component that is responsible for rendering comment data.
@@ -1802,3 +1790,17 @@ The following masking utility types are available to override:
18021790
- `Unmasked<TData>` - Unwraps `TData` into the full result type
18031791
18041792
For more information about other overridable types in Apollo Client, see the [TypeScript guide](../development-testing/static-typing).
1793+
1794+
## Troubleshooting
1795+
1796+
### Unique names
1797+
1798+
Fragment names must be unique across your entire application. If you reuse a fragment name, the `graphql-tag` library warns about the conflict at runtime to help prevent bugs:
1799+
1800+
```text
1801+
Warning: fragment with name SomeFragment already exists.
1802+
graphql-tag enforces all fragment names across your application to be unique; read more about
1803+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names
1804+
```
1805+
1806+
As a best practice, use descriptive, component-scoped fragment names (like `ItemFragment` or `UserProfileFragment`) to avoid name collisions.

0 commit comments

Comments
 (0)