Skip to content

How to reference smartquery key from result()? #445

Closed
@fnoop

Description

@fnoop

I'm trying to dynamically create smart queries to connect to multiple instances of the same backend API (connect to multiple servers running the same schema). This works:

this.$apollo.addSmartQuery('navSatFixMessage_' + api, {
        client: api,
        query: navSatFixQuery,
        manual: true,
        result (data) {
            this.navSatFixData[api] = data
        }
      })

Except that navSatFixData always ends up with a single element (the last value of api). Is there any way of retrieving the query key from the data passed to result, or from this.vm which is set as this value when calling result()?

Or would this require changing the call with the key as a second calling parameter?

Or can I override QueryResult somehow and stuff the key into the data, so it's passed to result that way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions