Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

(docs) - Fix errors page links (#828)

* fix docs

* remove anchors

* test with anchors above the links in markdown

* remove anchors

authored by

Jovi De Croock and committed by
GitHub
a364e2f1 6044b536

+23 -18
+23 -18
docs/graphcache/errors.md
··· 1 + --- 2 + title: Errors 3 + order: 6 4 + --- 5 + 1 6 # Help! 2 7 3 8 **This document lists out all errors and warnings in `@urql/exchange-graphcache`.** ··· 9 14 This is a supporting document that explains every error and attempts to give more 10 15 information on how you may be able to fix some issues or avoid these errors/warnings. 11 16 12 - ## (1) Invalid GraphQL document <a id="1"></a> 17 + ## (1) Invalid GraphQL document 13 18 14 19 > Invalid GraphQL document: All GraphQL documents must contain an OperationDefinition 15 20 > node for a query, subscription, or mutation. ··· 22 27 subscription. This error occurs when this is missing, because the `DocumentNode` 23 28 is maybe empty or only contains fragments. 24 29 25 - ## (2) Invalid Cache call <a id="2"></a> 30 + ## (2) Invalid Cache call 26 31 27 32 > Invalid Cache call: The cache may only be accessed or mutated during 28 33 > operations like write or query, or as part of its resolvers, updaters, ··· 42 47 This is a safe-guard to prevent any asynchronous work to take place, or to 43 48 avoid mutating the cache outside of any normal operation. 44 49 45 - ## (3) Invalid Object type <a id="3"></a> 50 + ## (3) Invalid Object type 46 51 47 52 > Invalid Object type: The type `???` is not an object in the defined schema, 48 53 > but the GraphQL document is traversing it. ··· 55 60 Check whether your schema is up-to-date or whether you're using an invalid 56 61 typename somewhere, maybe due to a typo. 57 62 58 - ## (4) Invalid field <a id="4"></a> 63 + ## (4) Invalid field 59 64 60 65 > Invalid field: The field `???` does not exist on `???`, 61 66 > but the GraphQL document expects it to exist.<br /> ··· 72 77 As the warning states, this won't lead any operation to abort or an error 73 78 to be thrown! 74 79 75 - ## (5) Invalid Abstract type <a id="5"></a> 80 + ## (5) Invalid Abstract type 76 81 77 82 > Invalid Abstract type: The type `???` is not an Interface or Union type 78 83 > in the defined schema, but a fragment in the GraphQL document is using it ··· 88 93 Check whether your schema is up-to-date or whether you're using an invalid 89 94 field somewhere, maybe due to a typo. 90 95 91 - ## (6) readFragment(...) was called with an empty fragment <a id="6"></a> 96 + ## (6) readFragment(...) was called with an empty fragment 92 97 93 98 > readFragment(...) was called with an empty fragment. 94 99 > You have to call it with at least one fragment in your GraphQL document. ··· 102 107 When you're calling a fragment method, please ensure that you're only passing fragments 103 108 in your GraphQL document. The first fragment will be used to start writing data. 104 109 105 - ## (7) Can't generate a key for readFragment(...) <a id="7"></a> 110 + ## (7) Can't generate a key for readFragment(...) 106 111 107 112 > Can't generate a key for readFragment(...). 108 113 > You have to pass an `id` or `_id` field or create a custom `keys` config for `???`. ··· 116 121 Please make sure that you include enough properties on your data so that `readFragment` 117 122 can generate a key. 118 123 119 - ## (8) Invalid resolver data <a id="8"></a> 124 + ## (8) Invalid resolver data 120 125 121 126 > Invalid resolver value: The resolver at `???` returned an invalid typename that 122 127 > could not be reconciled with the cache. ··· 130 135 Please check your schema for the type that your resolver has to return, then add a 131 136 `__typename` field to your returned resolver value that matches this type. 132 137 133 - ## (9) Invalid resolver value <a id="9"></a> 138 + ## (9) Invalid resolver value 134 139 135 140 > Invalid resolver value: The field at `???` is a scalar (number, boolean, etc), 136 141 > but the GraphQL query expects a selection set for this field. ··· 144 149 Please check that your resolvers return scalars where there's no selection set, 145 150 and entities where there is one. 146 151 147 - ## (10) writeOptimistic(...) was called with an operation that isn't a mutation <a id="10"></a> 152 + ## (10) writeOptimistic(...) was called with an operation that isn't a mutation 148 153 149 154 > writeOptimistic(...) was called with an operation that is not a mutation. 150 155 > This case is unsupported and should never occur. ··· 152 157 This should never happen, please open an issue if it does. This occurs when `writeOptimistic` 153 158 attempts to write an optimistic result for a query or subscription, instead of a mutation. 154 159 155 - ## (11) writeFragment(...) was called with an empty fragment <a id="11"></a> 160 + ## (11) writeFragment(...) was called with an empty fragment 156 161 157 162 > writeFragment(...) was called with an empty fragment. 158 163 > You have to call it with at least one fragment in your GraphQL document. ··· 166 171 When you're calling a fragment method, please ensure that you're only passing fragments 167 172 in your GraphQL document. The first fragment will be used to start writing data. 168 173 169 - ## (12) Can't generate a key for writeFragment(...) <a id="12"></a> 174 + ## (12) Can't generate a key for writeFragment(...) 170 175 171 176 > Can't generate a key for writeFragment(...) data. 172 177 > You have to pass an `id` or `_id` field or create a custom `keys` config for `???`. ··· 180 185 Please make sure that you include enough properties on your data so that `writeFragment` 181 186 can generate a key. 182 187 183 - ## (13) Invalid undefined <a id="13"></a> 188 + ## (13) Invalid undefined 184 189 185 190 > Invalid undefined: The field at `???` is `undefined`, but the GraphQL query expects a 186 191 > scalar (number, boolean, etc) / selection set for this field. ··· 189 194 GraphQL results should never contain an `undefined` value, so this warning will let you 190 195 know which part of your result did contain `undefined`. 191 196 192 - ## (15) Invalid key <a id="15"></a> 197 + ## (15) Invalid key 193 198 194 199 > Invalid key: The GraphQL query at the field at `???` has a selection set, 195 200 > but no key could be generated for the data at this field. ··· 212 217 return a unique ID for your entity or it needs to explicitly return `null` to silence 213 218 this warning. 214 219 215 - ## (16) Heuristic Fragment Matching <a id="16"></a> 220 + ## (16) Heuristic Fragment Matching 216 221 217 222 > Heuristic Fragment Matching: A fragment is trying to match against the `???` type, 218 223 > but the type condition is `???`. Since GraphQL allows for interfaces `???` may be ··· 235 240 When you pass an introspected schema to the cache, this warning will never be displayed 236 241 as the cache can then do deterministic fragment matching using schema information. 237 242 238 - ## (17) Invalid type <a id="17"></a> 243 + ## (17) Invalid type 239 244 240 245 > Invalid type: The type `???` is used with @populate but does not exist. 241 246 ··· 249 254 Check whether your schema is up-to-date or whether you're using an invalid 250 255 field somewhere, maybe due to a typo. 251 256 252 - ## (18) Invalid TypeInfo state <a id="18"></a> 257 + ## (18) Invalid TypeInfo state 253 258 254 259 > Invalid TypeInfo state: Found no flat schema type when one was expected. 255 260 ··· 273 278 This may either happen because you're missing the `__typename` and `id` or `_id` field or if the last two 274 279 aren't applicable to this entity a custom `keys` entry. 275 280 276 - ## (20) Invalid Object type <a id="20"></a> 281 + ## (20) Invalid Object type 277 282 278 283 > Invalid Object type: The type `???` is not an object in the defined schema, 279 284 > but the `keys` option is referencing it.