Skip to content

Commit 96570a1

Browse files
Dustin BGuillaume Chau
authored andcommitted
Don't require the key to match the query name (#186)
In "manual" mode, the user is setting the manually working with the value, so an error should not be thrown if the key isn't present in the response.
1 parent eee91e5 commit 96570a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/smart-apollo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export class SmartQuery extends SmartApollo {
232232
// No result
233233
} else if (typeof this.options.update === 'function') {
234234
this.vm[this.key] = this.options.update.call(this.vm, data)
235-
} else if (data[this.key] === undefined) {
235+
} else if (data[this.key] === undefined && !this.options.manual) {
236236
console.error(`Missing ${this.key} attribute on result`, data)
237237
} else if (!this.options.manual) {
238238
this.vm[this.key] = data[this.key]

0 commit comments

Comments
 (0)