Skip to content

Declarative cache doesn't work with unions #116

Closed
@martinbonnin

Description

@martinbonnin

Description

Follow up from this slack discussion.

type User @typePolicy(keyFields: "id") {
  id 
  name
}

type UserError {
  code
}

union UserResult = UserError | User

type Query {
  getUser(id: ID!): UserResult
}

The UserResult type doesn't have keyfields and therefore this branch is not taken.

More generally, union result types are awkward to work with the cache. See also apollographql/apollo-kotlin#3827

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions