-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Consider a schema that links a local remoteId to a resolved remoteObject by calling fetchRemote:
type Local {
id: String!
remoteId: String!
remoteObject: Remote
}
type Query {
fetchLocal(id: String!): Local!
fetchRemote(id: String!): Remote!
}
Currently, the local id always has to be part of the query, so the following query results in a null remoteObject:
query {
fetchLocal(id: "foo") { id remoteObject } // returns remoteObject as "null"
}
To get the remoteObject, the remoteId field has to be requested explicitly as well:
query {
fetchLocal(id: "foo") { id remoteId remoteObject } // returns proper remoteObject
}
Other libraries (looking at Atlassian Braid) manage to resolve the remote object either way, presumably by automatically adding the remoteId in such a case.
In a similar way, typed fragments always require the __typename to be present, which currently also has to be added manually.
To be discussed is whether this behavior should a) be implemented, b) be configurable, or c) only result in an explicit error message so that it is clear how the request needs to be adjusted to work as expected