We where running into a case where an object has a objectId field which is only unique inside its parent. We can access the parent from the object so it would be neat to be able to define the keyFields using non scalar types
Example:
type Author implements Node {
id: String!
}
type Book {
bookId: String! // only valid in the scope of the author
author: Author!
}
Describe the solution you'd like
have @typePolicykeyFields support non scalar types so we can define a scalar field in a non null non scalar field for the id:
extend type Book @typePolicy(keyFields: "bookNumber author.id")
this would add the following to ever query for Book
Use case
We where running into a case where an object has a
objectId
field which is only unique inside its parent. We can access the parent from the object so it would be neat to be able to define the keyFields using non scalar typesExample:
Describe the solution you'd like
have
@typePolicy
keyFields
support non scalar types so we can define a scalar field in a non null non scalar field for the id:this would add the following to ever query for
Book
and use this to build the cache key.