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

Fixed fragment matcher error message #3701

Merged
merged 8 commits into from
Aug 9, 2018
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## vNext



### Apollo Client (vNext)

- Adjusted the `graphql` peer dependency to cover explicit minor ranges.
Expand Down Expand Up @@ -36,6 +38,11 @@
[@hwillson](https://github.com/hwillson) in [#3774](https://github.com/apollographql/apollo-client/pull/3774) <br/>
[@hwillson](https://github.com/hwillson) in [#3779](https://github.com/apollographql/apollo-client/pull/3779)

### Apollo Cache In-Memory (vNext)

- Fix typo in `console.warn` regarding fragment matching error message. <br/>
[@combizs](https://github.com/combizs) in [#3701](https://github.com/apollographql/apollo-client/pull/3701)


## 2.3.7 (July 24, 2018)

Expand Down
9 changes: 5 additions & 4 deletions packages/apollo-cache-inmemory/src/fragmentMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ export class HeuristicFragmentMatcher implements FragmentMatcherInterface {
// If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the
// difference, so we warn the user, but still try to match it (backcompat).
warnOnceInDevelopment(
`You are using the simple (heuristic) fragment matcher, but your queries contain union or interface types.
Apollo Client will not be able to able to accurately map fragments.` +
`To make this error go away, use the IntrospectionFragmentMatcher as described in the docs: ` +
`https://www.apollographql.com/docs/react/recipes/fragment-matching.html`,
'You are using the simple (heuristic) fragment matcher, but your ' +
'queries contain union or interface types. Apollo Client will not be ' +
'able to accurately map fragments. To make this error go away, use ' +
'the `IntrospectionFragmentMatcher` as described in the docs: ' +
'https://www.apollographql.com/docs/react/recipes/fragment-matching.html',
'error',
);

Expand Down