-
Notifications
You must be signed in to change notification settings - Fork 30
Description
We get a lot of these warnings from graphql-tag
in the console:
index.ts:46 Warning: fragment with name AddedDelta 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
(The link in the warning is dead)
From apollographql/graphql-tag#269:
we have a global module cache... of the fragments we parse — that means that somewhere else in your application, there's another fragment defined with the same name. we protect against this because if you were to interpolate both of them into the same GraphQL document, it would fail validation. you can disable this warning by invoking disableFragmentWarnings ( https://github.com/apollographql/graphql-tag#warnings )
However we also get this warning for fragments defined only once in the whole app, because at
cylc-ui/src/services/workflow.service.js
Lines 546 to 550 in 88753e2
// And here we set the new merged-query. Voila! | |
// NOTE: we-recreate the gql object because it contains derived attributes | |
// which may only get updated by doing this | |
// see https://github.com/cylc/cylc-ui/issues/1110 | |
subscription.query.query = gql(print(finalQuery)) |
it is re-evaluating the fragment definitions (which have already been cached the first time) each time the query changes because they are included in the query document.