In my schema there is a type called Article:
type Article {
id: ID!
updated: DateTime
headline: String
subline: String
}
To update it, there is an appropriate input type that is used by the mutation updateArticle(id: ID!, article: ArticleInput!):
input ArticleInput {
headline: String
subline: String
}
The mutation itself is as follows:
mutation updateArticle($id: ID!, $article: ArticleInput!) {
updateArticle(id: $id, article: $article) {
id
updated
headline
subline
}
}
The article is always saved in its entirety (not separate fields one after another), and therefore, when I pass the article to the mutation that I previously selected, it produces errors such as Unknown field. In field "updated", Unknown field. In field "__typename"and Unknown field. In field "id". They have the main reason that these fields are not defined in the input type.
This is the correct behavior as per specification :
(...) This unordered card must not contain entries with names, it is not determined by the field of this type of input object, otherwise an error must be thrown.
, . , ?
, , , , . , , . , , , , , .
, ?
apollo-client, react-apollo graphql-server-express.